Ah, reminds me of the old self-extracting gzip executable trick. I used that once a very long time ago to make a 4k linux intro, before I realized to be competitive I should switch to windows to be able to use Crinkler, which is superior even though the decompressor is part of the executable.
Comment on introducing copyparty, the FOSS file server
tripflag@lemmy.world 1 day agosooo this is one of the things that started with someone saying “wouldn’t it be funny if…”
if you open copyparty-sfx.py in a text editor, you’ll see how – but please make sure to use an editor which is able to handle about 600 KiB of comments which contain invalid utf8 / binary garbage 😁
I ended up rolling my own packer since I wanted optimal encoding efficiency, and everything I could find would do stuff like base85 or ucs2 tricks, but it turns out python is perfectly happy with binary garbage in comments if you declare that the file is latin-1
so it realizes all hope is lost :D
the only drawback of the sfx.py is that it needs to extract to $TEMP before running, so that’s the slight advantage of the zipapp (the .pyz alternative), but that suffers from some performance reduction in return, and is more hermetic (doesn’t let you swap out the bundled dependencies with fresh versions as easily if necessary)
chellomere@lemmy.world 1 day ago
tatterdemalion@programming.dev 10 hours ago
Why not use zipapp?
docs.python.org/3.13/library/zipapp.html