Description
Goal: Currently, the web playground utilizes JavaScript equivalents to mock the Python mini-projects. Let's make it a true Python playground by integrating Pyodide (Python compiled to WebAssembly) to run original Python code dynamically inside the browser.
Requirements
- Include Pyodide via CDN or npm in the web application.
- In
playground.js, provide an option/button "Run Python Code".
- When clicked, initialize Pyodide, load the corresponding project's
.py file, redirect sys.stdout to the playground terminal console, and execute it.
- Allow stdin inputs from the user to be passed to Pyodide when prompt loops are encountered.
Deliverables
Description
Goal: Currently, the web playground utilizes JavaScript equivalents to mock the Python mini-projects. Let's make it a true Python playground by integrating Pyodide (Python compiled to WebAssembly) to run original Python code dynamically inside the browser.
Requirements
playground.js, provide an option/button "Run Python Code"..pyfile, redirectsys.stdoutto the playground terminal console, and execute it.Deliverables
web-app/index.htmlandplayground.html.