🐍 Python Course · Stage 6 · Lesson 88 of 89 · Python Playground
Course Overview →

▶ Experiment freely here — no pressure to follow a sequence.

← Simple Web Server Python Snippets →
thecodex.expert · The Codex Family of Knowledge

Python Playground

Real Python 3 running in your browser — powered by Pyodide (CPython compiled to WebAssembly). Standard library included. No install, no account.

● Runs in browser Python 3.12 Standard library ~8MB first load (cached)
🐍 Python 3
Output
Press Run to load Python and execute…

Ctrl+Enter to run  ·  First run downloads Pyodide (~8MB) and caches it  ·  Code runs locally — never sent to a server

Try these examples

Click any example to load it into the editor above, then hit Run.

How this works

Pyodide is CPython — the standard Python interpreter — compiled to WebAssembly. When you press Run for the first time, the browser downloads Pyodide (~8MB) from a CDN and caches it. Every subsequent run is instant, even after refreshing the page.

The playground intercepts sys.stdout and sys.stderr using Python's io.StringIO, captures all print() output and error tracebacks, and displays them in the output pane. Your code runs entirely in your browser — nothing is sent to a server.

What's available: the full Python standard library — math, json, datetime, re, collections, itertools, functools, pathlib, dataclasses, typing, and more. Network calls (requests, urllib) won't work in the browser sandbox. NumPy and other scientific packages can be loaded via import micropip; await micropip.install('numpy') but require async execution.

What to try next