News for hackers. Stuff that matters.
Re:PyScript: An open source platform for Python in the browser by bArray on Friday August 16, 2024 @05:26AM (#41264708)
I've been looking for something like this, but I'm still unsure it quite hits the spot. I think that this would be very interesting if it allows a person to run a blog like a Jupyter notebook.

I have a lightweight hack [1] that runs Python in markdown documents and can output basic images/graphs - which is embedded into static pages. The point was being able to write an article that somebody else could see the code behind it and test themselves, e.g. [2]. One of the browsers I test in is Netsurf with JS disabled. Unfortunately it doesn't look great in Lynx.

[1] https://gitlab.com/danbarry16/pandoc-highlight-filter

[2] https://coffeespace.org.uk/projects/langtons-ant-universe.ht...

Re:PyScript: An open source platform for Python in the browser by DerThorsten on Friday August 16, 2024 @06:54AM (#41265177)
There is jupyerlite which does exactly that https://github.com/jupyterlite/jupyterlite

Kernels are compiled to wasm and can therefore run in the browser.

Try it out at: https://jupyterlite.readthedocs.io/en/stable/_static/lab/ind...

Its easy to create your own deployments, there is a template repo for that https://github.com/jupyterlite/demo

Re:PyScript: An open source platform for Python in the browser by bArray on Monday August 19, 2024 @10:20AM (#41291279)
> There is jupyerlite which does exactly that https://github.com/jupyterlite/jupyterlite

Had a quick look, this seems quite cool!

Is there alternative output is the WASM is not run? It would be good if it defaulted to a pre-run static output, otherwise users could be left with nothing?