Try pyjs#
The REPL below runs Python with pyjs in your browser
(xeus-python kernel in
JupyterLite).
For a full fledged example, open the
tour of the Python API
in JupyterLite, or see how synchronous Python code can
wait for JavaScript promises
(pyjs.run_sync).
64 bit (wasm64)#
All of this also exists as a 64 bit build (wasm64, can use more than 4 GB of memory, needs a browser with WebAssembly memory64 support): JupyterLite with the wasm64 Python kernel, e.g. the tour of the Python API.
From JavaScript#
pyjs can also be used from JavaScript: the
tour of the JavaScript API
runs in the JavaScript kernel of
jupyterlite-javascript-kernel
(the notebook uses the IFrame runtime, it also works with the Web Worker runtime).
It loads the pyjs runtime (pyjs_runtime_browser.js / .wasm) and a packed
environment, deployed next to the JupyterLite in pyjs-runtime/wasm32/ and
pyjs-runtime/wasm64/ (the wasm64 one when the browser supports memory64).