PyScript: Run Python in your HTML
21–30 of 71 posts
Re: PyScript: Run Python in your HTML
#22Any reason to use a custom element `py-script` vs a script tag with custom type?
Re: PyScript: Run Python in your HTML
#23For 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!)
They don't seem to be working on Android Chrome.
A few brief delays came with the matplotlib examples but nothing too bad (seconds not minutes)
Re: PyScript: Run Python in your HTML
#24For 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…
# add the task element to the page as new node in the list by cloning
taskHtml = task_template.clone(task_id, to=task_list)
taskHtmlContent = taskHtml.select('p')
taskHtmlContent.element.innerText = task['content']
taskHtmlCheck = taskHtml.select('input')
task_list.element.appendChild(taskHtml.element)
We can surely make such things easier in 2022?Re: PyScript: Run Python in your HTML
#25Earlier quoted context omitted.
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…
As a way of interacting with the DOM, this makes me very uncomfortable: # add the task element to the page as new node in the list by cloning taskHtml = task_template.clone(task_id, to=task_list) taskHtmlContent = taskHtml.select('p') taskHtmlContent.element.innerText = task['content'] taskHtmlCheck = taskHtml.select('input') task_list.element.appendChild(taskHtml.element) We can surely make such things easier in 202…
Re: PyScript: Run Python in your HTML
#26The GitHub repo has a more concrete overview. https://github.com/pyscript/pyscript Would be nice if there was a demo on the page that didn’t require installing NPM and other stuff on my machine.
Re: PyScript: Run Python in your HTML
#27Re: PyScript: Run Python in your HTML
#28Don't hate me for saying this, but I can imagine combining this with Electron and develop desktop apps with Python.
Re: PyScript: Run Python in your HTML
#29And 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 feature completeness is important, Pyodide and Coldbrew are probably best.
[0] https://github.com/pyscript/pyscript/blob/main/pyscriptjs/sr...
[1] https://github.com/pyodide/pyodide
Re: PyScript: Run Python in your HTML
#30Of course it would be better if Chrome shipped with Python support, but this is a good effort. Does Wasm generally support other languages ?