PY Play Documentation
Everything you need to use PY Play — a free browser-based Python notebook.
Cells
Press + Code to add a Python cell, + Text for a markdown cell. Double-click a rendered text cell to edit it.
Running code
Click ▶ on a cell or press Shift+Enter. Use Run All to execute every code cell from top to bottom. Hit Stop if a cell is stuck — it restarts the Python worker.
AI suggestions
Toggle the AI button in the header. While typing in a code cell, ghost-text completions appear. Press Tab to accept, Esc to dismiss.
Notebooks & storage
Notebooks auto-save to your browser. Open the folder icon in the toolbar to switch, rename, export, or delete.
Installing & importing Python packages
PY Play runs Python in your browser through Pyodide, so you can install most pure-Python packages and the major scientific stack without leaving the page.
Using the Packages panel
- Click Packages in the toolbar.
- Type a package name (e.g.
numpy,pandas,matplotlib,scipy,requests,scikit-learn) and press Install. - Wait for the success toast, then
importit from any code cell.
Importing modules in your code
Once installed, use a normal Python import:
import numpy as np
import pandas as pd
df = pd.DataFrame({"x": np.arange(5), "y": np.arange(5) ** 2})
print(df)What works (and what doesn't)
- ✅ Pre-built scientific packages shipped with Pyodide: numpy, pandas, scipy, scikit-learn, matplotlib, sympy, networkx, and more.
- ✅ Pure-Python wheels from PyPI — most utility libraries install directly via the Packages panel (powered by
micropipunder the hood). - ⚠️ Packages with C extensions that aren't pre-compiled for WebAssembly won't install. There's no system
pipor compiler in the browser. - ⚠️ Anything that needs the OS (subprocesses, raw sockets, GPU, filesystem outside the virtual FS) is unavailable.
Packages persist for the current notebook session. Reloading the page reinstalls them on next use — usually a few seconds because Pyodide caches the wheels.
