Python
Online Python IDE
A project gives Python the IDE side of the site: folders, packages, data files and uploads in one place, saved to your account and run with Python 3.12 or the version set in Project details. The playground above uses the same editor and console, and Save as project turns its files into a project.
Try it aboveHow Python runs here
- Versions
- Python 3.11, 3.12 (default), 3.13, 3.14, 3.15
- Run
python3 -u main.py- Limits per run
- 256 MB memory, 15 s of CPU time on 2 cores, 2 MB of output
- Time
- Up to 10 minutes a run (30 on a paid plan); waits 2 minutes for input (5 on a paid plan)
- Sandbox
- Each run gets its own Linux sandbox with no network access. Text files your program writes next to your code open as new tabs.
- Good to know
- NumPy, pandas, Matplotlib and openpyxl installed.
A project with a package and data
Python imports a folder that has an __init__.py as a package, and the program runs from the project’s top folder, so paths like data/orders.csv work as written. This project totals orders by region with pandas and saves the result as an Excel file:
main.py sales/__init__.py (empty) sales/report.py data/orders.csv
# sales/report.py import pandas as pd def totals_by_region(path): orders = pd.read_csv(path) orders["total"] = orders["qty"] * orders["price"] return (orders.groupby("region", as_index=False)["total"].sum() .sort_values("total", ascending=False)) # data/orders.csv region,qty,price North,3,9.50 South,1,120.00 North,10,4.25 East,2,15.00 South,4,7.75
# main.py from pathlib import Path from sales.report import totals_by_region summary = totals_by_region("data/orders.csv") print(summary.to_string(index=False)) Path("out").mkdir(exist_ok=True) summary.to_excel("out/summary.xlsx", index=False) print("Saved out/summary.xlsx")
$ python3 -u main.py region total South 151.0 North 71.0 East 30.0 Saved out/summary.xlsx
After the run, out/summary.xlsx appears in the file tree. A project takes back everything the program writes, files in folders and binary files included; the playground keeps only top-level text files.
Moving around a Python project
- Run executes the open file. To run main.py whatever tab is open, choose Run this file by default in its menu in the file tree.
- Ctrl+P opens a file by typing part of its name (rep finds sales/report.py), Ctrl+B shows or hides the file tree, and Alt+W closes the open file.
- F2 and Del rename or delete the file selected in the tree; a renamed run file stays the run file.
- Upload data files into any folder, such as a CSV into data/, and download the whole project as a .zip.
- Project details hold the name, description, Python version (3.11 to 3.15) and visibility.
Debugging Python
The debugger runs your code in the browser with Pyodide (CPython 3.12 compiled to WebAssembly):
- Click in the margin left of a line number for a breakpoint, in any .py file, then press Debug.
- When it stops, Continue, Step over, Step into and Step out move on, and the paused line is highlighted in the editor.
- Variables lists the locals at that point, Call stack the calls that led there, and Breakpoints every stop you’ve set across files.
- input() still works: type the answer in the console while debugging.
Debugging is for Python only; projects in other languages run but can’t be stepped through.
What plans add for Python
- Free accounts get 3 public projects of up to 3 MB each. Basic allows unlimited private projects of up to 25 MB, shared with people you choose and open to forking; Premium raises the size to 100 MB (see Pricing).
- Premium starts a Linux session per project with a terminal that keeps running when you reload. pip install fetches packages from PyPI, the one site the session can reach, and run main.py runs a file the way the Run button does.
- Premium also turns on the Python language server: F12 goes to a definition, Shift+F12 finds references, F2 renames a symbol across files, Shift+Alt+F formats the file, and hovering a name shows its docs.
- On Basic and Premium the agent takes a task such as “add a --month option and a test for it”, edits the files, runs the program, fixes what fails, and shows every change as a diff you can undo.
Questions
Can I import my own modules and packages?
Yes. In a project, a folder with an __init__.py imports as a package, as in from sales.report import totals_by_region. The playground has no folders, so there you keep modules next to main.py.
Can I install packages?
NumPy, pandas and openpyxl are preinstalled. Premium’s terminal can pip install from PyPI, and the “This browser” engine installs a package when you import it.
Does the debugger work with input()?
Yes. When the program asks for input while you’re debugging, type it in the console as usual.
How do students get their own copy of my code?
Share from the playground: everyone who opens the link gets a copy they can run and change. A shared project opens read-only, and forking it needs a paid plan.
Are projects private?
Free projects are public, so anyone with the link can open and run them. Private projects, shared only with the people you choose, need Basic or Premium.