Re:Introducing PyScript (summary of PyCon keynote)
by j0hnyl on Thursday June 23, 2022 @12:23PM
(#31851352)
Maybe what it offers is abstraction. Boilerplate not required for immediate results, just a pyscript tag.
Re:Introducing PyScript (summary of PyCon keynote)
by lo5 on Thursday June 23, 2022 @12:54PM
(#31851857)
I understand that, but it's not much of an abstraction:
const
pyodide = await loadPyodide(),
input = document.getElementById('#input').textContent,
output = await pyodide.runPythonAsync(input);
document.getElementById('#output').textContent = output;
I can see there are other tags (py-env, etc.) that provide some yaml to fetch additional assets, but again, nothing significant that warrants the hype.Maybe I'm missing something?
In my experience, it's trivial accomplish this with Pyodide.
Here's a web worker that hosts Pyodide and loads packages, PyPI wheels, external modules, etc. and launches type=text/python script tags in-browser:
https://github.com/h2oai/nitro/blob/main/web/public/nitride....
About ~100 lines of code.