I really really like this, but 4 MB zipped is a bit of a hard sell :/ I've had a need to deploy small ad-hoc HTML tools at work, though, and my Python is much better than my JS, so maybe it's worth it.
For one of the examples, I saw it coming down with pyscript.js - 1.1 MB, pyodide.asm data + wasm of 16 MB, and each python package as a separate wheel download (cool!), matplotlib of 6MB :)
PyScript: Run Python in your HTML
31–40 of 71 posts
Re: PyScript: Run Python in your HTML
#32This uses Pyodide [0] under the hood [1], which is CPython compiled to WebAssembly. In all my tests of it, loading takes a long time ~5 seconds. Coldbrew [2], another distribution of CPython on Wasm, is another option with similar load times. And Brython [3] is a completely different option without long load time: a Python interpreter implemented in JavaScript. If load time is important, Brython is pretty nice. If fe…
Re: PyScript: Run Python in your HTML
#33For some reason, I can't see this linked anywhere on the site, but there is an examples page: https://pyscript.net/examples/ (This was presented today as a pycon keynote talk!)
Re: PyScript: Run Python in your HTML
#34Thank you for posting this. Of course it would be better if Chrome shipped with Python support, but this is a good effort. Does Wasm generally support other languages ?
Re: PyScript: Run Python in your HTML
#35For some reason, I can't see this linked anywhere on the site, but there is an examples page: https://pyscript.net/examples/ (This was presented today as a pycon keynote talk!)
okay thought it wasn't working because it seems to take a long time for the spinner to go away. but I'm very impressed with the todo.py! This is what frontend should be and in 5 years or so I wouldn't be surprised to see python taking over. If only the initial payload for the python runner was smaller and if only browsers started supporting webassembly/python stack out of the box!!! from datetime import datetime as d…
This seems highly unlikely. Each browser maker would have to have two teams now (one for JavaScript and one for Python). An additional language would add a new security/hacking vector. They would need to keep both languages at parity which would probably slow development and make testing much more complicated. Would JS and Python be able to both work on the same web page at the same time? What if both tried to interact with the same element at the same time? This is just thoughts off the top of my head. I’m sure the real issues would be much more complicated.
Re: PyScript: Run Python in your HTML
#36Don't hate me for saying this, but I can imagine combining this with Electron and develop desktop apps with Python.
Asking these web devs turned desktop app developers to learn python is probably a bridge too far…
Re: PyScript: Run Python in your HTML
#37This uses Pyodide [0] under the hood [1], which is CPython compiled to WebAssembly. In all my tests of it, loading takes a long time ~5 seconds. Coldbrew [2], another distribution of CPython on Wasm, is another option with similar load times. And Brython [3] is a completely different option without long load time: a Python interpreter implemented in JavaScript. If load time is important, Brython is pretty nice. If fe…
https://anvil.works/blog/python-in-the-browser-talk
(We chose one of the Python-to-JS compilers, https://skulpt.org, for the Anvil web-app platform, because it's much lighter weight than this. It's a couple of hundred kb on the wire, and you can call to the server for any heavy lifting.)
Re: PyScript: Run Python in your HTML
#38This uses Pyodide [0] under the hood [1], which is CPython compiled to WebAssembly. In all my tests of it, loading takes a long time ~5 seconds. Coldbrew [2], another distribution of CPython on Wasm, is another option with similar load times. And Brython [3] is a completely different option without long load time: a Python interpreter implemented in JavaScript. If load time is important, Brython is pretty nice. If fe…
Re: PyScript: Run Python in your HTML
#39Re: PyScript: Run Python in your HTML
#40Don't hate me for saying this, but I can imagine combining this with Electron and develop desktop apps with Python.
Isn’t the whole point of electron that people don’t want to learn a new language? Asking these web devs turned desktop app developers to learn python is probably a bridge too far…