Run the playground. Move with WASD or arrows.
Upload this HTML as index.html to your HTTPS website. It loads pinned CodeMirror and Pyodide libraries from public CDNs; first boot needs internet and may take a while.
Pygame mode uses pygame-ce and an SDL canvas. Use an async game loop and await asyncio.sleep(1/60) every frame. Click the display for keyboard focus. A synchronous infinite loop in graphics mode can freeze the browser tab. Worker mode can always be stopped, but has no Pygame display.
await asyncio.sleep(1/60)
Each Run starts a clean runtime. All project .py files and session assets are copied into /home/pyodide. Generated files are offered for download when the program finishes. Assets are included in project exports but not in automatic local saving.
/home/pyodide
Static imports are scanned with Python's AST. Standard libraries and local modules are skipped, Pyodide packages are loaded first, and missing packages are requested through micropip. Import-to-package mappings include PIL→Pillow, sklearn→scikit-learn, cv2→opencv-python, yaml→PyYAML, and bs4→beautifulsoup4. For dynamic imports or unusual names use Extra packages. Desktop-only packages, subprocesses, system pip and arbitrary native wheels will not work.
Shortcuts: Ctrl/⌘ Enter run; Ctrl/⌘ S save locally; Escape stops a responsive run. Find, replace, undo and redo require the enhanced editor CDN to load. Your code and packages execute locally; imported packages can make network requests.