PYTHON STUDIO / 01
main.py
Live displaypygame-ce
⌘Your next idea starts here.

Run the playground. Move with WASD or arrows.

Console
Make it yours · 25 visual controls

Python, with a playground.

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.

Real pygame, browser rules

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.

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.

Automatic packages

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.

25 workspace features

    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.