packages = ["bokeh", "pandas", "numpy", "networkx", "diagrams", "scikit-learn", "pillow", "matplotlib", "plotly"] [[fetch]] files = ["diagrams_base.py"] from = "../../python/diagrams/" [[fetch]] files = ["pyscript_manager.py", "data.py"] to_folder = "lib" from = "../../python/lib/" [[fetch]] files = ["bokeh_utils.py"] from = "../../python/bokeh/" [[fetch]] files = ["matplotlib_utils.py", "plotly_utils.py"] from = "../../python/matplotlib/" [[fetch]] files = ["agent.py", "trainer.py", "utils.py", "metrics_chart.py", "crossover.py", "__init__.py"] to_folder = "ml/neuro" from = "../../python/ml/neuro/" [[fetch]] files = ["trainer.py"] to_folder = "ml/grokking" from = "../../python/ml/grokking/"

Loading...

Example 1: Pyodide REPL


Example 2: MicroPython REPL

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

🐍 Python Console