4 ms·
There is this: https://pyodide.org/en/stable/console.html https://pyodide.org/en/stable/console.html Not sure what you mean by python in chromium however, I ass
by leventt 5y ago
There is this: https://pyodide.org/en/stable/console.html https://pyodide.org/en/stable/console.html
Not sure what you mean by python in chromium however, I assume, pyiodide may already be doing this.
- 999900000999 5y agoI want Python to be used the same way JS is used. As in a native 3.7 interrupter in Chrome
- edgyquant 5y agoI don’t see how that could be done without nerfing a lot of the power of JS. JS was bred by the web and is entirely async. Python has no concept of callbacks or promises etc. JS is perfect for frontend design because that’s what it was created from the ground up for
- 999900000999 5y agoPython would be optional here. You could still use JS while Python support catches up.
- ekimekim 5y agoPython has always had the ability to do callbacks (ie. first class functions), though admittedly it's not a common pattern and the stdlib doesn't support it for IO (also its anonymous function syntax is poor). There have been several libraries that provide the concept of a promise, but with modern python these are built into the stdlib with native async/await support, though many interfaces are still sync-only (though you can work around that with things like gevent that monkey-patch those interfaces to work with an event loop under the hood). I agree that python would be a poor fit for the kind of uses that JS in the browser usually serve, but it's really a matter of ecosystem, not core language design.