This project is a web application that allows users to enter Python code in a textarea on a webpage. When the "Execute Code" button is clicked, the entered Python code is sent to a PHP script on the server. The PHP script saves the code to a file, executes it using the Python interpreter, captures the output and any errors, and then sends the result back to the webpage without reloading the entire page.
- HTML
- CSS
- JavaScript (AJAX)
- PHP
- Python (venv)
- Interactive web interface for writing and executing Python code.
- Real-time display of code execution output and errors.
- Secure execution environment (sandboxed) to mitigate risks of executing arbitrary code.
- Utilizes AJAX to send and receive data asynchronously without page reload.
- Separate output and error handling for better user experience.
- Clone the repository to your local machine.
- Set up a web server (e.g., Apache, Nginx) and configure it to serve the project directory.
- Install virtualenv using pip3
pip3 install --user virtualenv
- Now create a virtual environment
python -m venv env
- Access the application by opening the index.php file in a web browser.
- Modify the HTML, JavaScript, and PHP files to suit your requirements.
- Customize the styling using CSS or another front-end framework.
- Ensure proper input validation and security measures, especially when executing user-provided code.
- Consider additional features such as syntax highlighting, saving code history, etc.
- Gabriel Coelho's Template: Sheet Template