web-python logo web-python
Loading…
No directory selected
    Font 14px

    about

    web-python is a web-based Python interpreter powered by Pyodide, leveraging its experimental local directory mounting feature to sync the WASM filesystem with a local writable directory.

    This feature is not yet available on all browsers. See documentation for showDirectoryPicker for more information.

    usage

    Select a local directory, enter arguments for the Python interpreter (e.g. main.py arg1 arg2), and click Run. The arguments field suggests .py files from your project as you type.

    To run a one-liner without a directory, use the -c flag: -c "print('hello world!')"

    importing from GitHub

    Click "Import from GitHub" to fetch a public repository. Accepted formats:

    user/repo
    user/repo@branch
    https://github.com/user/repo
    https://github.com/user/repo/tree/branch
    https://github.com/user/repo/tree/branch/sub/dir

    If a local directory is mounted the files are written there (persisted to disk). Otherwise they are loaded into the interpreter's in-memory filesystem for the current session. main.py is auto-selected in the arguments field after a successful import.

    keyboard shortcuts

    Ctrl+Enter / Cmd+Enter — Run (from the arguments field)
    Ctrl+L / Cmd+L — Clear terminal
    Ctrl+Wheel — Zoom terminal font size
    / — Navigate file suggestions
    Escape — Dismiss file suggestions

    using external packages

    Dependencies are read from requirements.txt and/or pyproject.toml in your project root and installed via micropip before each run. Both files are merged if present; reinstall only happens when either file changes.

    requirements.txt — one package per line:

    numpy
    pandas>=2.0
    matplotlib

    pyproject.tomlPEP 621 and Poetry formats:

    # PEP 621
    [project]
    dependencies = ["numpy", "pandas>=2.0"]
    
    # Poetry
    [tool.poetry.dependencies]
    numpy = "*"
    pandas = "^2.0"

    Not all PyPI packages are compatible with Pyodide's WebAssembly environment. See the list of supported packages.

    issues

    Questions, bugs, or feature requests — open an issue on GitHub.

    disclaimer

    web-python is an independent project and is not affiliated with or endorsed by the Python Software Foundation (PSF). The Python logo is a trademark of the PSF, used here under the trademark usage policy.

    import from GitHub

    Fetch a public GitHub repository into the interpreter. Accepted formats:

    user/repo
    user/repo@branch
    https://github.com/user/repo
    https://github.com/user/repo/tree/branch
    https://github.com/user/repo/tree/branch/sub/dir

    Files are loaded into the interpreter's in-memory filesystem for the current session.

    repository