Error loading web-python, see the developer console.
web-python
does not work on mobile devices or older
browsers. See the about page for more information
about how to use web-python
when you're on a supported
device and browser. This is tested on Chromium and Firefox.
Close
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 .