web-python logoweb-python

web-based Python interpreter

No directory selected

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

To use web-python, select a local directory to run Python code in. Then, enter arguments to pass to the Python interpreter (for example, main.py arg1 arg2), and click "Run".

Alternatively, you can execute one-liners without a local directory much like you would with a normal Python interpreter: entering the code in quotes with the -c flag. For example, to run the Python code print('hello world!'), enter -c "print('hello world!')" as Python arguments.

using external packages

By including a requirements.txt file in your directory root, you can specify external Python packages to be installed in the interpreter before execution.

Lines of requirements.txt are fed directly to micropip.install. So, if you want to use numpy, pandas, and matplotlib, then write a requirements.txt file with the following content:

numpy
pandas
matplotlib

This makes them available to Python code.

issues

If you have any questions, bugs, or feature requests, please open an issue on GitHub.