Skip to content

Pyodide Integration Issue #1068

@nishtha-agarwal-211

Description

@nishtha-agarwal-211

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

  • Integrate Pyodide SDK in web-app/index.html and playground.html.
  • Modify the terminal component to fetch the target Python script dynamically and execute it.
  • Manage WebWorker context if necessary to prevent UI freezing during long-running loops.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions