Online Python compiler

Run Python code online free, no sign-up: write a Python 3 program, give it input on stdin and see its output, errors and run time in your browser.

How do I run Python code online?

This is an online Python 3 compiler and interpreter: write a script in the editor, put the lines it reads in the Input box and press Run. It runs on the server and shows what it printed, the traceback if it raised one, and how long it took — free, with no sign-up.

How it works

  1. Write your program. A Python program is a script: no main function is needed, and the file runs top to bottom. Define functions first and call them below, or put the work under if __name__ == "__main__": as you would in a file.
  2. Give it input. input() reads one line without its newline; sys.stdin.read() reads everything at once, which is quicker for large input. input().split() gives the words of a line and map(int, input().split()) its numbers. Put every line the program reads in the Input box before you run it.
  3. Run it. Press Run or Ctrl+Enter. You get what the program printed, any compiler or runtime error, and how long it ran. The first run without an account asks a quick check that you are a person.

Who it is for

Anyone writing Python who wants it run now: a student checking a lab program or an exam answer, someone on a machine where nothing can be installed, or a learner trying Python before setting it up.

Frequently asked questions

Why do I get EOFError: EOF when reading a line?
The program called input() more times than the Input box has lines. Add the missing lines, or read with sys.stdin.read().split() and take values from that list so the count does not matter.
Is it Python 3?
Yes. print is a function, / always gives a float (7 / 2 is 3.5; use // for whole-number division) and strings are Unicode. Code written for Python 2 — print x, raw_input() — will not run.
Is this online compiler free, and do I need an account?
It is free and needs no account. Without one, a network gets up to 60 runs an hour, and the first run asks a quick check that you are a person. A free account removes the check and gives you an allowance of your own, which matters in a college lab where everyone shares one connection.
Can my program ask for input while it runs?
No. The program runs once on the server, start to finish, so everything it reads from standard input must be in the Input box before you press Run — one line there is one line the program can read. A program that waits for input the box does not have either fails at the end of input or runs until it is stopped.
Is my code saved or shared?
Your code is kept in this browser as you type, per language, so it is still there when you come back. When you press Run it is sent to be compiled and run — SQL on CodeKairo's own server, the other languages on a code-execution service — and only the output comes back. CodeKairo does not store it or show it to anyone.
What are the limits?
A program can be up to 64 KB and its input up to 16 KB. A run that takes too long is stopped and reported as Time limit exceeded — usually an endless loop, or a program waiting for input that is not in the box. There is no file system to keep files in and no way to install packages: each language has its standard library.