R.E.P.L
PyScript's REPL provides an interactive Python environment directly in your browser.
What You Can Do:
- Interactive Coding: Write and execute Python code on the fly
- Multiple Interpreters: Choose between Pyodide or MicroPython
- Editable Code: Modify examples and see results instantly
- Standard Library Access: Use Python built-in modules
Implementation:
REPL editors are created using special script types:
<script type="py-editor">
# Your Python code here
print("Hello from Pyodide!")
</script>
<script type="mpy-editor">
# MicroPython version
print("Hello from MicroPython!")
</script>Use Cases:
- Educational tutorials and code demonstrations
- Interactive documentation
- Prototyping Python algorithms
- Live coding environments