Swelıty
Tools for everyone

Free Online Python Playground

Run Python in your browser and see what it prints in a console. Real Python with the standard library, and packages such as numpy that load when you import them.

Press Run, or Ctrl or Cmd + Enter, to run your code. Everything you print shows in Console. The first run downloads Python, which is about 10 MB. Use Stop if your code never ends. input() is not available.

main.py

Preview

Console

Output appears here. Press Run, then try console.log("Hello")

How to use

  1. Write Python in the editor.

  2. Press Run, or Ctrl or Cmd + Enter. The first run downloads Python, which takes a few seconds.

  3. Read the output in the console. print() writes to it, and an error shows its traceback there.

  4. Use Stop if your program never ends. Turn on Auto-run only for short programs.

  5. Copy the code, download a zip of your files or clear the editor with the icons above it.

  6. Open the full screen editor for more room, and use the A buttons to resize the text.

Why use this tool

  • Real Python

    CPython compiled to WebAssembly, with the standard library, so what you learn here is the Python you know.

  • Packages on import

    Packages that ship with Pyodide, such as numpy, are downloaded when your code imports them.

  • Console with tracebacks

    Printed output and errors appear in the console, with the line that failed.

  • Isolated preview

    Your code runs in an isolated frame, so it cannot reach this site or your other tabs.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Run real Python in your browser with nothing to install. Write a program, press Run, and everything you print appears in the console beside the editor. Python runs through WebAssembly, so the standard library is available, and popular packages such as numpy load automatically when you import them. It suits learning Python, trying a snippet or working through an exercise. The first run downloads about 10 MB, which your browser keeps afterwards.

Frequently asked questions

Python 3.14, running through Pyodide, which compiles Python to WebAssembly. It is loaded from a public CDN.

Packages that ship with Pyodide, such as numpy, load automatically when you import them, which downloads them the first time. Other packages from PyPI are not available.

Python itself is about 10 MB. It is downloaded once and then kept by your browser, so later runs start much faster.

No. There is no keyboard input while the program runs, so input() ends with an error. Put the values in your code instead.

Files are in a small temporary file system that disappears when the page is reloaded. Network access is limited by the browser, so requests to many sites are blocked.

Not yet. The Format button works for the other playgrounds, but not for Python.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.