Expose HN: Fling Python code on GitHub.dev with zero-setup

Run Python code on VS Code without installing a Python intepreter! 🤯 This magic is enabled by Pyodide 🪄, a port of CPython to WebAssembly/Emscripten that lets you run Python on the web! 🚀 How it works Open a python file Run it by clicking green play button on the top right corner of the…

95
Expose HN: Fling Python code on GitHub.dev with zero-setup

Meet this stunning ingredient!!

Fling Python code on VS Code without installing a Python intepreter! 🤯

This magic is enabled by Pyodide 🪄, a port of CPython to WebAssembly/Emscripten that ability that you just can bustle Python on the acquire!

🚀 The procedure it truly works

  1. Originate a python file
  2. Fling it by clicking inexperienced play button on the head appropriate corner of the editor.
  3. Gape the output!
  4. It is doubtless you’ll presumably be ready to also stop the execution of your file by clicking on the crimson stop button.

Identified Limitations

  1. Definite modules can not be loaded on Pyodide due to obstacles of WASM.
    Computer screen: It is doubtless you’ll presumably be ready to be ready to install sure modules the usage of micropip. Focus on with Pyodide documentation for added recordsdata.
  2. Python code would be gradual to bustle when there are a quantity of imports, as a brand contemporary web employee is created whenever and the modules will seemingly be downloaded on every bustle. This changed into as soon as performed to make certain local imports are handled properly as there is now not always a easy procedure for Pyodide to refresh local imports. Once the mechanism of this caching is extra obvious, a extra setting gracious workaround may per chance presumably per chance come up.
  3. Give a snatch to for stdin and visible output is WIP.
  4. IntelliSense may per chance presumably per chance very nicely be restricted as modules may per chance presumably per chance no longer be installed on your filesystem.
  5. time.sleep is treated as a no-op by Pyodide
  6. Since your code is being bustle within a high-level stay up for, where you’d usualy exhaust asyncio.bustle(predominant()), you’ll be succesful to maintain to exhaust stay up for predominant() as an quite diverse for the expected results.

Acknowledgments

This extension builds on high of Pyodide.

Read More
Fragment this on knowasiak.com to take a look at with folks on this matterRegister on Knowasiak.com now if you occur to may per chance presumably per chance be no longer registered yet.

Charlie Layers
WRITTEN BY

Charlie Layers

Fill your life with experiences so you always have a great story to tellBio: About: