Python

Running Python in the Browser: Pyodide and WASM

PyScript, created by Anaconda, is an experimental but promising new technology that makes the Python runtime available as a scripting language in WebAssembly-enabled browsers. Every modern, commonly used browser now supports WebAssembly, the high-speed runtime standard that many languages (like…

Running Python in the Browser: Pyodide and WASM

Python in the browser went from novelty to real when Pyodide compiled CPython to WebAssembly — the actual interpreter, NumPy and pandas included, running client-side with no server.

How it works

CPython compiled to WASM, loaded as a module:

<script>
  const pyodide = await loadPyodide();
  pyodide.runPython("print(2 + 2)");
</script>

That's real CPython — not a reimplementation — so scientific packages work: NumPy, SciPy, matplotlib render in the tab. PyScript wraps it into declarative tags.

What it's actually for

Interactive tutorials and notebooks without a backend, client-side data analysis that never uploads the dataset, teaching environments with zero install. JupyterLite runs a whole notebook environment in WASM this way.

Where it breaks

Sockets don't exist in browsers — no real network requests, no database connections. The WASM payload is megabytes before your code loads. And CPU-bound work runs at WASM speed — fine for demos, wrong for heavy compute. It answers "Python without a server," not "Python without the internet's limits."

$ tail -f /forums

Discussion

Comments live on the community forums — sign in there to reply.