treyhunner,
@treyhunner@mastodon.social avatar

One of these functions prints and the other returns, but they seem like they do the same thing.

Read more 👉 https://trey.io/ibXciv

julian,
@julian@fietkau.social avatar

@treyhunner I've been meaning to ask you Trey (I hope it's okay to go off-topic), do you have anything written down about how the Python interpreter behind the Python Morsels pastebin works?

I recently used Pyodide to create a browser demo for one of my old Python projects: https://fietkau.software/timberbot

It was pretty simple to put together, but it suffers from chonky loading and initialization times that I don't see on Python Morsels. Are you using a different engine, or did you create one yourself?

treyhunner,
@treyhunner@mastodon.social avatar

@julian it's a custom compilation of CPython to WebAssembly. The CPython repository has a directory with instructions under Tools/wasm.

The JavaScript I use was originally based on the code in the python.html and python.worker.js files in that directory.

I definitely stumbled through it but I have a process that works well enough for my setup now.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • ngwrru68w68
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • Youngstown
  • everett
  • slotface
  • rosin
  • osvaldo12
  • mdbf
  • kavyap
  • cubers
  • megavids
  • modclub
  • normalnudes
  • tester
  • khanakhh
  • Durango
  • ethstaker
  • tacticalgear
  • Leos
  • provamag3
  • anitta
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines