Python Online Compiler
Real CPython in your browser — with stdin, files and a stop button.
Try before you buy.
- Free preview: your program runs in full on your device, with its output shown under a MySmartCoPilot mark.
- Locked until you unlock it: copy.
- Unlock: Pro pass, ₹179 for 30 days or ₹79 for 1 week, a one-time payment unless you choose automatic renewal. Unlock: Pro pass, $5.99 for 30 days or $2.99 for 1 week, a one-time payment unless you choose automatic renewal.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Ctrl+Enter (⌘+Enter) runs. Tab indents; press Esc, then Tab, to leave the editor. Your code is kept in this browser.
Output
Python (about 13.5 MB) is downloaded the first time you press Run.
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the Python Online Compiler
Write Python and press Run. This is real CPython 3.14 — the standard Python interpreter, compiled to WebAssembly by the Pyodide project — running on your own device, so print, input(), exceptions, the standard library and even top-level await behave as they do on a computer with Python installed. Output streams in as the program prints; an error shows Python’s traceback, and selecting a line in it jumps to that line in the editor.
Type what input() should read into the Input (stdin) box, and add data files (a CSV, a JSON, a text file) for your program to open(). Programs run in a Web Worker on an isolated MySmartCoPilot sandbox origin, never on this page: an endless loop cannot freeze the tab, Stop ends it at once, and every run has a time limit.
Without a pass you see a free preview: your program runs in full and its output shows under a MySmartCoPilot mark, without copying. A Pro pass unlocks the output, with Copy. Your own code is yours at any time: main.py downloads it.
How to use it
- Write or paste your program, or pick an example. The editor indents Python blocks for you (4 spaces), closes brackets and highlights syntax.
- If the program calls
input(), type the answers into Input (stdin), one line per call. To work with files, choose Add files; they appear in the program’s current folder under their own names (accents are dropped and characters other than letters, digits, spaces,.,_and-become_; the page tells you the new name). - Press Run or Ctrl+Enter (⌘+Enter). The first run downloads Python (about 13.5 MB) with a progress bar; later runs start at once.
- Read the output. For an error, select a line of the traceback (for example
main.py, line 6) to jump there. Stop ends a run; the time limit (30 seconds by default) stops it automatically. - With a pass, or after unlocking this run, copy the output. main.py downloads your code at any time, with or without a pass.
Examples
name = input("What is your name? ")
age = int(input("How old are you? "))
print(f"Hi {name}! In 10 years you will be {age + 10}.")
Input (stdin):
Asha
29What is your name? How old are you? Hi Asha! In 10 years you will be 39.
The prompts are printed but your answers are not echoed, exactly as when a terminal pipes input into python3 main.py.
def average(values):
return sum(values) / len(values)
print(average([4, 8, 15]))
print(average([]))9.0
Traceback (most recent call last):
File "main.py", line 5, in <module>
print(average([]))
~~~~~~~^^^^
File "main.py", line 2, in average
return sum(values) / len(values)
~~~~~~~~~~~~^~~~~~~~~~~~~
ZeroDivisionError: division by zeroPython 3.11 and later mark the failing part of the line with ~ and ^. Select a File "main.py", line … entry to jump to that line.
Common uses
- Practising Python for a course or an interview without installing anything — on a school computer, a Chromebook or a phone.
- Checking a quick calculation, a regular expression or a date computation with the standard library.
- Processing a CSV or JSON file with
csv,json,statisticsorcollectionswhile the data stays on your device. - Showing someone how a snippet behaves, step by step, with
printoutput and real tracebacks.
What is available
- The whole Python standard library that works in a browser:
math,statistics,random,datetime,json,csv,re,collections,itertools,functools,dataclasses,decimal,fractions,sqlite3,hashlib,textwrap,unittest,asyncioand more. input()andsys.stdinread the Input (stdin) box; after its last line they get end-of-file (EOFError).- Before each run the program’s folder (
/home/pyodide, the current directory) is emptied and the files you added are written to it, soopen("data.csv")works. Each run starts with fresh variables in that clean folder, like runningpython3 main.pyagain. - Like the Python prompt, the value of the last line is shown as the result (
[2, 4, 6]).sys.exit(0)ends a program successfully; another exit status counts as an error.
What is not available
- Packages from PyPI —
pip install, numpy, pandas, requests — are not installed here; only the standard library is.import numpystops withModuleNotFoundError. - No windows or graphics:
tkinterandturtleneed a desktop and do not work in a browser. - No network sockets, so
urllib.request,http.clientandsocketcannot connect to servers, and there is nosubprocessoros.system.zoneinfohas no time-zone database here (use UTC offsets withdatetime.timezone). - Files your program writes stay inside the sandbox and are deleted before the next run; print the results to see them.
Limitations
- Python compiled to WebAssembly runs somewhat slower than a native installation; very heavy computations are better run on your computer.
- A run is stopped after the time limit (10 seconds to 2 minutes); stopping restarts the interpreter, from your browser’s cache.
- Output is limited to 200,000 characters per run. Up to 50 files, 50 MB together, can be added.
- Your code and stdin (up to 300,000 characters each) are kept in this browser (local storage) for your next visit; Reset clears them. Added files are not kept.
Privacy
On this device; its files download once
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot. The first time you press Run, Python itself (about 13.5 MB: the CPython interpreter and its standard library, compiled to WebAssembly) is downloaded from a separate, isolated MySmartCoPilot address; your browser keeps it for later visits. Your code, input and files are handed to it inside your browser and never uploaded.
Frequently asked questions
What do I get without a pass?
Without a pass, Python Online Compiler shows your program runs in full on your device, with its output shown under a MySmartCoPilot mark. Until you unlock it, the result can’t be copied. A Pro, Premium or Ultimate pass, a one-time payment unless you choose automatic renewal, unlocks the full result. The pricing page lists the passes and their prices.
Which Python version is it?
CPython 3.14, as built by Pyodide 314.0.7. Run import sys; print(sys.version) to see the exact build.
Can I install packages with pip?
No. Only the standard library is available, because packages would have to be downloaded from a third-party server, which this site does not do. Most learning exercises and small scripts need nothing else.
How do I give my program input?
Type it into Input (stdin) before you run: each input() call reads the next line. If the program asks for more lines than you typed, it stops with EOFError: EOF when reading a line.
Is my code uploaded?
No. Your code, input and files go from this page to the sandbox frame inside your browser and run on your device. Only Python itself is downloaded, once.
Why is the first run slow?
The first run downloads the Python interpreter and standard library (about 13.5 MB) and starts it, which takes a few seconds on a good connection. Your browser keeps the files, so later runs — also on later visits — start almost at once.
Why did my program stop with a time-limit message?
It was still running when the time limit was reached — often a while loop whose condition never becomes false. Choose a longer limit next to the Run button if the work really takes longer.
Learn more
Lessons on MySmartCoPilot Learn that use this tool:
- What Python is and how it runs your code Free lesson, Pro answers
- The Python REPL, scripts and the -m switch Free lesson, Pro answers
- Editors, notebooks and the in-browser runner Free lesson, Pro answers