This project is a simple React application that allows you to execute Python code in a containerized environment. The application uses the Monaco Editor for code editing and communicates with a backend service to execute the Python code.
- Code editor with syntax highlighting and word wrap.
- Execute Python code and display the output.
- Highlight syntax errors and navigate to the error line in the editor.
- Save the code in local storage.
- Node.js
- npm or yarn
- Clone the repository:
git clone https://github.com/raspbeep/python-exec-demo.git
cd python-exec-demo- Install the dependencies:
yarn- Start the development server:
yarn dev- Open your browser and navigate to
http://localhost:3000.
- Write or paste your Python code in the editor.
- Click the "Submit" button to execute the code.
- The output will be displayed in the output area below the editor.
- If there is a syntax error, the editor will highlight the error line.
src/App.tsx: Main component of the application.src/App.css: Styles for the application.
For development, local flask server can be started by python container/main.py after installing the requirements pip install -r requirements.txt and changing the fetch URL in App.tsx to 127.0.0.1:5000. Otherwise, deployed container on Google Cloud Run can execute entered python code in a safe environment.
- React
- Monaco Editor
This project is licensed under the MIT License.