Offline Python compiler
After one visit while online, the editor and Python keep working without internet.
Run this once while online
# Running this once also loads pandas, so it works offline later
import pandas as pd
scores = pd.DataFrame({
"name": ["Asha", "Ben", "Chen"],
"score": [88, 92, 79],
})
print(scores)
print("Average:", scores["score"].mean())
Open this in the editor and press Run.
Get it ready for offline use
- Open the editor while online and press Run once, so Python finishes loading.
- Import any libraries you will need, such as pandas or matplotlib, and run them once too.
- Optional: install it as an app from your browser (the install icon in the address bar, or Add to Home screen on a phone).
- Next time you have no internet, open pythoncompiler.io or the app. Your files and Python are there.
What works offline
Writing and running Python, input(), files you made, turtle drawings, notebooks, and every library you loaded at least once while online. Your code is saved in the browser as you type, online or not.
Still needs the internet: signing in, saving to GitHub, opening someone else's share link for the first time, and loading a library you have never used before.
Questions
Can I run Python offline in the browser?
Yes. After one visit while online, the editor and Python load without internet.
Do libraries like pandas work offline?
Yes, once you have imported them one time while online. A library you have never used needs the internet the first time.
Do I need to install anything?
No. Installing it as an app is optional; it just gives you an icon and its own window.
What if I clear my browser data?
The stored copy goes with it, along with your files. Open the site once while online to get the editor back.
More: the editor · Python turtle · exercises · programs with output