Guide · Start

Run, stop and debug

Run a file, answer input(), stop anything, and step through code with breakpoints.

Run

Run (⌘R) saves every file, clears the Output panel, switches to it, and runs the Python file you have open. If the open file is not a Python file, it runs the project's entry point: the first of main.py, manage.py, hello.py and app.py that exists. Touch and hold Run for Debug and Run tests.

Code runs in CPython 3.14, embedded in the app, on this device. It has the full standard library, real files in your project folder, and the network, like any program. Tracebacks point at your file and line.

input()

When your program calls input(), the Output panel shows a field labelled input(). Type a line and press Return or the send arrow. EOF sends end of input, which makes input() raise EOFError, as Ctrl-D does on a computer. In the terminal, the line you type goes to the program instead.

Stop

While code runs, Run turns into Stop (⌘.). Stop interrupts endless loops, time.sleep, a waiting input(), blocking sockets and asyncio, and keeps asking if your code catches the first interrupt. If Python still has not stopped after several tries, Pythilo says This run cannot be stopped from here. That happens only inside compiled code that never returns. Your files are already saved, so closing Pythilo from the app switcher and opening it again loses nothing.

Status and results

The top of the Output panel shows what Python is doing (Starting Python, Running, Waiting for input, Paused, Stopping), that it runs on this device, and a timer. When the run ends it says Finished in … s, Stopped after … s or Exited with code N. If your program left threads running, Pythilo names them: Python keeps them until the app closes.

Very fast, very long output is trimmed to what the screen can keep (about 400 KB), with a note saying how much was skipped.

Run tests

Run tests, from the Run button's menu or the ⋯ menu, runs pytest -q in the project's terminal. When the project has a test_*.py file or a tests folder, a pytest -q chip also appears above the terminal.

The debugger

Tap a line number in a Python file to set a breakpoint; tap it again to clear it. Then choose Debug from the Run button's menu, or Debug and the file name in the Debug panel. Without a breakpoint, the debugger stops on the first line.

When it pauses, the Debug panel opens with:

Stop works while paused, too.

Threads, servers and async

Breakpoints also stop inside threads, inside web request handlers while a Django, Flask or FastAPI server runs, and inside async code. One thread pauses at a time and the panel names it; the others keep running. Debugging notebook cells is not supported yet.

One Python for everythingAll projects share one Python process. Pythilo cleans up between runs (modules, paths and environment), but that is tidying, not a security boundary. Only run code you trust. See What runs on iOS.