A browser-based Python playground that lets you write and execute Python code in real-time. Built with security and performance in mind, PyRunner provides a sandboxed environment for learning and experimenting with Python.
- Real-time Python code execution in the browser
- Secure sandboxed environment
- Built-in Python reference documentation
- Code editor with syntax highlighting
- Command history and code examples
- Keyboard shortcuts for improved workflow
- Frontend Framework: React with TypeScript
- Python Runtime: Pyodide (WebAssembly-based Python)
- Code Editor: CodeMirror 6
- Build Tool: Vite
- Styling: CSS Modules
- Deployment: Heroku
- Restricted module imports
- Memory usage limits (50MB)
- Execution time limits (5 seconds)
- Disabled file system operations
- Blocked system commands
- Custom hook for keyboard shortcuts
- Responsive side panel with drag-to-resize
- Real-time code execution with output capture
- Error handling and timeout management
- Mobile-first responsive design
- Zero external UI dependencies
- Clone the repository:
git clone https://github.com./andrewjamesmoore/py-runner.git
- Install dependencies:
cd py-runner
npm install
- Start the development server:
npm run dev
The application is built with a component-based architecture focusing on:
- Modularity: Each component has a single responsibility
- Performance: Optimized rendering and code execution
- Security: Sandboxed Python environment
- Accessibility: Keyboard navigation and screen reader support
- Responsiveness: Adapts to different screen sizes
PyRunner was developed as a portfolio project to demonstrate:
- Modern React development practices
- TypeScript implementation
- WebAssembly integration
- Security considerations in browser-based code execution
- Responsive UI/UX design
- Performance optimization
Try PyRunner live at: https://pyrunner.net
MIT License - feel free to use this code for your own projects!
Andrew James Moore