Python
LiveCodes can run Python in the browser using Brython, a Python 3 implementation for client-side web programming.
Brython is a light-weight Python interpreter written in JavaScript. However, It does not allow loading external packages from PyPI.
If you need to import external packages including scientific Python packages like numpy, pandas, scipy, matplotlib, and scikit-learn, you may want to use Python (Wasm), which uses Pyodide the CPython port to WebAssembly.
Usage
LiveCodes runs Python code in the browser. There is no server required to run the code and no need to install Python.
In addition, since the Python code is running on the client-side, it has access to the JavaScript scope, including the page DOM and browser APIs. See the starter template for an example.
Standard Library
Many modules of the Python standard library are functional. See Brython distribution for details.
JavaScript Interoperability
Interaction with the page DOM and JavaScript can be achieved using browser
and javascript
modules. See this guide for using the DOM API.
Check the starter template for an example.
Language Info
Name
python
Extensions
.py
Editor
script
Compiler
Version
Brython v3.12.3, running Python v3.12
Code Formatting
Not supported.
Example Usage
Starter Template
https://livecodes.io/?template=python
Links
- Python
- Brython
- Python (Wasm) in LiveCodes