Python Playground

Python 3 (WASM)

Execute real Python 3.12 code directly in your browser with WebAssembly. Standard libraries (json, math, re, collections, itertools) included. Zero server roundtrips.

Python 3.12 (Pyodide 0.26.2)
WASM Ready on demand
Python 3 Source
0 lines · 0 chars Python
Terminal (stdout / stderr)
Ctrl/Cmd+Shift+C
Click "Run" (⌘↵) to execute Python code in WebAssembly.
Ready Terminal

About This Tool

Runs standard CPython compiled to WebAssembly (Pyodide) directly inside your browser thread. Code executes locally with full privacy and zero server roundtrips.

Includes essential standard libraries: json, math, datetime, re, collections, itertools, random, urllib.parse, and more for testing data manipulation algorithms.

Key Features

  • Four starter snippets: Algorithms & Math, JSON Data Structures, Classes & Dataclasses, and Regex Extraction.
  • Live runtime status pill: Shows whether Pyodide is idle, loading, active, or ready for execution.
  • Separate stdout/stderr streams: Normal output and runtime tracebacks captured and styled distinctly.
  • Execution duration timer: Displays precise elapsed runtime milliseconds for each script run.
  • Terminal clipboard actions: One-click copy and clear controls for terminal output.
  • Keyboard shortcuts: Execute Python scripts instantly with Cmd/Ctrl+Enter without leaving the editor.

Frequently Asked Questions

Can I install third-party packages like numpy or requests?
No. Only the Python standard library modules Pyodide loads by default (json, math, re, collections, itertools, datetime, random, urllib.parse, and similar) are available; there is no package-install step wired into this tool.
Why does the first run feel slower than the rest?
The first Run downloads the Pyodide runtime from a CDN and initializes it in your tab. Every run after that reuses the already-loaded instance, executing almost instantly.
Can my script read input or access files?
No. There is no stdin or virtual filesystem wired up: only what your script writes to stdout/stderr is captured and shown in the terminal panel.