Help Center
PythonExecutor help: FAQs and getting started
How to run code in the playground, share it, install packages and use the course, challenges and visualizer, plus answers to common questions and fixes for common problems.
Getting started
Run your first Python program in under a minute.
- 1
Open the Python playground. Python loads in a few seconds; the badge next to the file name says Python ready when it is done.
- 2
Type or paste your code into
main.py, or keep the sample program that is already there. - 3
Press Run, or Ctrl+Enter (Cmd+Enter on a Mac). The output appears in the terminal. On a phone, the Output tab opens by itself.
- 4
If your program calls
input(), click the terminal, type your answer and press Enter. - 5
Keep going: add files in the sidebar, install packages with the pip install box, or press Share to send your code to someone.
Frequently asked questions
What is PythonExecutor?
A free website for writing and running code in your browser. It has a Python playground, a PHP playground and a C playground, plus a free Python course, Python challenges, a Python visualizer and ready-to-run code examples.
Is it free? Do I need an account?
Everything is free and there is no account or sign-up. Your code, course progress and challenge progress are saved in your browser.
How can Python run inside my browser?
The playground uses Pyodide: the standard CPython interpreter compiled to WebAssembly, which browsers can run. Python runs on your own device, in the page, so your Python code is never sent to a server.
Which versions are used?
Python 3.12, PHP 8.3 and C compiled with GCC 13.2.
Is my code private?
Python code runs on your own device, not on our servers. C and PHP code is sent to Wandbox, a free online compiler service, to be run. We use Google Analytics and Microsoft Clarity to see how the site is used. Clarity records visits, and those recordings can include the code you write and your programs' input and output, so do not type passwords or other personal details into your programs. The privacy policy has the details.
How do I save my code?
You do not need to: the playground saves your files in this browser as you type, and they are there the next time you visit.
They are not saved if you clear your browser data or use a private window, and they do not follow you to another browser or device. To keep a copy elsewhere, use Share and save the link, or copy the code into a file.
How do I share my code?
Press Share. A link is copied to your clipboard; anyone who opens it gets their own copy of your files, ready to run. The code is stored inside the link itself, so nothing is uploaded and the link keeps working.
Can I install packages like numpy or pandas?
Yes. Type package names into the pip install box (for example numpy pandas) and press Install, then import them as usual. Pure-Python packages from PyPI work, as do popular packages that have been built for Pyodide, such as numpy, pandas and scipy.
Installed packages last until you reload the page, so install them again after a reload.
Can my program use input()?
Yes. When a Python program calls input(), it pauses and the terminal waits for you to type an answer and press Enter, just like on your own computer. This works on phones and tablets too.
If your browser blocks the background helper this needs (some private-browsing modes do), the question appears in a small pop-up instead; your answer is still shown in the terminal. In the C and PHP playgrounds, type the input into the stdin box before you press Run.
Can my program read and write files?
Yes, files from the sidebar. Before every run, the files in the sidebar are copied into Python, so open("data.txt") can read a data.txt you created there, and one file can import another. Your program cannot read files from your computer, and files it creates are not added to the sidebar.
Can I draw graphics, use turtle or show matplotlib charts?
Yes. matplotlib charts work in the playground: each plt.show() adds the chart under Plots, next to the text output, with a button to download it as a PNG. See Matplotlib Online for examples. For turtle drawings, use Python Turtle, and for games, the Pygame Playground. Windows from tkinter cannot open in the browser.
Can my program access the internet?
Mostly no. Python runs inside the browser's security sandbox, so ordinary network code such as urllib or requests calls to other websites usually fails.
Does it work on phones and tablets?
Yes. On small screens the playground shows Input and Output tabs to switch between the editor and the terminal. The course, challenges and visualizer also work on phones.
Does it work offline?
No. You need an internet connection to open the site and to download the Python runtime when the playground loads. C and PHP need the internet every time you run, because they run on Wandbox.
Using the playground
The editor
The editor is Monaco, the same editor that powers VS Code. It has syntax highlighting, automatic indentation, bracket matching and find (Ctrl+F). On phones and tablets a simpler editor is used instead, so touch selection, select all, copy and paste work as usual. Long lines wrap onto the next line so you never have to scroll sideways. Everything you type is saved automatically.
Running code and the terminal
Run (or Ctrl+Enter) runs the file that is open in the editor. The terminal clears at the start of each run and then shows everything your program prints, including error messages with the line where they happened. The badge in the terminal header shows ok or error, and how long the run took.
Files and folders
Use the buttons at the top of the Files sidebar to create files and folders, and the small buttons that appear next to each file to rename or delete it. Files can import each other: the sample program imports average from utils.py. Run always runs the file that is open.
The Clear button
Clear empties the file that is open in the editor, so you can start from a blank page. It does not delete the file or clear the terminal. Use it with care: the code is removed from that file.
Installing packages
Type one or more package names into the pip install box, separated by spaces or commas, and press Install. Progress appears in the terminal. Once installed, import the package as usual.
Sharing
Share copies a link that contains all your files. Paste it into a message, a forum post or your notes. Opening the link loads a copy of the files, so the person you send it to can change them without affecting yours.
PHP and C
Choose another language from the menu next to the file name, or open the PHP playground or C playground directly. Each language keeps its own file, so switching back brings your code back. If your program reads input, type it into the stdin box before pressing Run: in PHP read it with fgets(STDIN), in C with scanf or fgets.
Keyboard shortcuts
On a Mac, use Cmd where Windows and Linux use Ctrl.
| Keys | What it does | Where |
|---|---|---|
| Ctrl + Enter (Cmd + Enter) | Run your code | Playground, course |
| Ctrl + Enter (Cmd + Enter) | Run the examples | Challenges |
| Ctrl + Enter (Cmd + Enter) | Visualize the code | Visualizer editor |
| Ctrl + F (Cmd + F) | Find in the file | Code editor |
| Ctrl + / (Cmd + /) | Comment or uncomment the line | Code editor |
| Alt + ↑ / ↓ | Move the line up or down | Code editor |
| Tab / Shift + Tab | Indent or outdent | Code editor |
| Ctrl + Z (Cmd + Z) | Undo | Code editor |
| ← / → | Step back or forward | Visualizer |
| Home / End | Jump to the first or last step | Visualizer |
Learning tools
Free Python course
Short lessons, one step at a time, with a terminal beside each lesson and quizzes and exercises that are checked in your browser. Your place and progress are saved, so you can pick up where you left off.
Python challenges
32 problems in four levels, from very easy to hard. Write the function, press Run examples to check the worked examples, then Submit to run the hidden tests too. Hints open one at a time, and the explained solution unlocks once you solve the challenge.
Python visualizer
Paste a short program and press Visualize to step through it line by line, with every variable, list and function call drawn as a diagram. It covers the core language; runs stop after 1,000 steps.
Code examples
Ready-made programs in Python, PHP and C, grouped by topic. Each one opens in the playground with one click, so you can run it and change it.
Troubleshooting
Something not working? Find the problem below.
Running code
The badge says “Loading Python…” for a long time
The first time you open the playground, your browser downloads the Python runtime (several megabytes), which takes a few seconds on a good connection and can take a minute on a slow mobile one. The badge changes to Still loading Python… while it is still downloading. Later visits are faster because it is cached.
If the badge says Python failed to load, the terminal shows the reason; reload the page to try again. Ad blockers and some school or office networks block cdn.jsdelivr.net, where the runtime is downloaded from; allow it, or try another network.
My program never finishes
It is probably stuck in a loop that never ends, or waiting for you to answer an input() in the terminal. There is no Stop button yet: reload the page to stop it. Your files are saved, so nothing is lost.
input() opens a pop-up instead of waiting in the terminal
On phones, tablets and Safari the terminal uses a small background helper (a service worker) to pause your program. If the browser blocks it, as some private-browsing modes do, each input() question appears in a pop-up instead. Reloading the page once in a normal window usually brings the terminal input back. In the pop-up, type your answer and tap OK; tapping Cancel ends the input, and Python stops with EOFError.
I pressed Run but nothing was printed
Check that your program prints something: a function only runs when you call it, and a value only shows when you print() it. On a phone, make sure the Output tab is selected.
Input
input() is not waiting for my answer
Click or tap inside the terminal so it has focus, then type and press Enter. In the PHP and C playgrounds, put the input into the stdin box before pressing Run.
ValueError: invalid literal for int()
input() always returns text. int("12") works, but int("") or int("twelve") does not. Check what you typed, and use .strip() to remove stray spaces.
Packages
ModuleNotFoundError after I installed a package
Packages are lost when the page reloads, so install it again. Also check that you installed the name used on PyPI, which is not always the name you import: beautifulsoup4 is imported as bs4, pillow as PIL.
A package will not install
Packages that contain compiled C code only work if a version has been built for Pyodide. If the terminal says it cannot find a pure Python wheel for it, the package cannot run in the browser yet.
Saving and sharing
My code has disappeared
Files are saved in this browser only. They are lost if browser data was cleared, and you will not see them in a private window, another browser or another device. Also check that Clear was not pressed, which empties the open file.
A share link shows “Invalid share link”
The link was probably cut off when it was copied: the code lives inside the link, so every character is needed. Ask for the complete link and paste it as one line.
PHP and C
My PHP or C program does not get any input
These programs cannot pause and wait for typing. Put all the input in the stdin box before pressing Run, one value or line at a time as your program reads it.
“Remote runner error” or a very slow run
PHP and C run on Wandbox, a free online service, so they need an internet connection and occasionally Wandbox is busy. Wait a moment and press Run again.
Display
The colours are too dark or too bright
Use the sun and moon button at the top right of every page to switch between the dark and light theme. Your choice is remembered.
Privacy and your data
Your Python code runs on your own device, and your files and progress are stored in your browser, not on our servers. C and PHP code is sent to Wandbox to be run. We use Google Analytics and Microsoft Clarity to see how the site is used. Clarity records visits, and those recordings can include the code you write and your programs' input and output, so do not type passwords or other personal details into your programs.
Read the full privacy policy, or learn more about PythonExecutor.