Python Notebook in the Browser

Write code and Markdown cells, run them with Shift+Enter, see tables and plots inline, install pure-Python packages, and save as a standard .ipynb file.

S'executa al teu navegador. Els fitxers mai no surten del dispositiu. Mira com comprovar-ho

…

Com es fa

  1. 1
    Start Python

    Read the download note and press Start Python.

  2. 2
    Write cells

    Edit the code cells or add + Code and + Text cells.

  3. 3
    Run

    Press Shift+Enter or ▶ to run a cell, or Run all for the whole notebook.

  4. 4
    Add packages

    Import Pyodide packages directly or install others with micropip.

  5. 5
    Organise

    Move cells, switch between code and Markdown, clear outputs or restart.

  6. 6
    Save

    Save .ipynb for Jupyter and Colab or export a .py script.

Sobre aquesta eina

This notebook gives you Python without installing anything. It uses Pyodide, the CPython interpreter compiled to WebAssembly, loaded from the official Pyodide CDN when you press Start Python. Cells work the way they do in Jupyter: code cells keep variables between runs, the last expression is displayed, pandas DataFrames appear as tables, matplotlib figures appear as images and print output streams under the cell. Markdown cells hold headings, notes and lists. Notebooks open and save in the standard .ipynb format, so you can move between this page, JupyterLab, VS Code and Google Colab.

Who it is for

Students learning Python or data analysis, teachers who need a notebook that works on school laptops, analysts doing a quick calculation on a CSV, and developers testing a snippet.

What loads and when

Python itself is about 10 MB. Scientific packages load automatically the first time a cell imports them: pandas, NumPy and matplotlib add roughly 20 MB. Everything is cached by the browser afterwards. Your code and data stay on the device.

Working with cells

- Shift+Enter runs the cell and moves to the next one (a new cell is added at the end). - Ctrl+Enter runs in place. - ▶, ↑, ↓, M or {} and × on each cell run, move, switch type and delete. - Run all stops at the first error, as Jupyter does. - Restart clears your variables without reloading Python.

Packages

Packages built for Pyodide, such as pandas, NumPy, SciPy, scikit-learn and matplotlib, load from imports. Other pure-Python packages from PyPI can be installed with the micropip box. Packages with C extensions that Pyodide has not built cannot be installed.

Files and formats

Save .ipynb writes nbformat 4.5 with cell ids, outputs, plots as PNG and execution counts. Open .ipynb reads notebooks from Jupyter or Colab, including their saved outputs. Export .py writes a script with # %% cell markers. HTML outputs from opened files are shown in a sandboxed frame so they cannot run scripts on this page.

Worked example

The starter notebook builds a DataFrame of six months: orders from 120 to 205 and revenue from 2,400 to 4,410 EUR. The avg_order column is revenue divided by orders, 20.00 in January and 21.51 in June. The chart cell draws a bar chart, and the last cell prints "Revenue grew 83.8 % from January to June".

Limits

Code runs on the page's main thread, so a long loop freezes the page until it ends and cannot be interrupted except by reloading. There is no file system beyond memory, no network sockets, and requests to other sites are subject to CORS. Heavy machine learning or datasets bigger than a few hundred MB are not practical in a browser.

Exemple resolt

6-month sales table: average order 20.00 to 21.51 EUR, revenue up 83.8 % from January to June.

En resum

Preguntes freqüents

Do I need to install Python?

No. Python runs in your browser through Pyodide.

Can I use pandas and matplotlib?

Yes, they load automatically the first time you import them.

Can I open notebooks from Jupyter or Colab?

Yes, any .ipynb in nbformat 4 opens with its cells and saved outputs.

How do I install another package?

Type its name in the micropip box and press Install; pure-Python packages work.

Is my code sent to a server?

No. Only the Python runtime and packages are downloaded; your code runs locally.

How do I stop a cell that runs forever?

Reload the page. Your cells are saved, but variables in memory are lost.

Totalment gratisSense cost, sense registre
Els fitxers es mantenen privatsTot funciona al teu navegador
Fàcil en el teu idiomaDisponible en molts idiomes