1.4.0 • Published 3 years ago
react-python-editor v1.4.0
Moocfi Python Editor
React Python Editor is a React component that provides an in-browser editing and running environment for Python code. The editor is based on Pyodide python runtime environment that is run using webworkers.
Usage
Install with npm i react-python-editor.
The editor component can be used in a following way:
import { PythonEditor } from "react-python-editor"
const App = () => {
// ...
return <ProgrammingExercise editorHeight="400px" outputHeight="200px" />
}Optional properties:
debugShow and log debug information if set totrue.editorHeightHeight of the editor. Defaults to400px.outputHeightMaximum height of the output content in pixels.
Setting up the project
- Clone the project on GitHub
- Go to the project root directory and run
npm ci&npm run encode:worker - Go to the
exampledirectory and runnpm ci
Running the project
To run the project in example environment, go to the example directory and
run npm start.
If you make any changes to the worker, you will always need to run the encode:worker command again.
License
This project is forked from https://github.com/rage/python-editor
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license, (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.