RustPython is a Python interpreter written in Rust. This demo is
compiled from Rust to WebAssembly so it runs in the browser.
Input your Python code below and click Run (or Ctrl+Enter), or you can open up your browser's devtools and play with
rp.pyEval('1 + 1')
Here's some info regarding the
stdout: either a string with a css selector to a textarea element or a function that receives a string when the
vars: an object that will be available in python as the variable
js_vars. Only functions and values that can be serialized with
JSON.stringify()will go through.
Limited Interaction with browser is possible from Python by using
browser module. Browser APIs such as
fetch() are included in the module.