Run a script from a zip file

Nice little trick to package a python program or slip something past a malware scanner

You could stick it inside anything that's based on zip like a jar, apk, docx, etc. You can even make it executablearrow-up-right.

$ mkdir test
$ echo "print('hello world')" > test/__main__.py
$ zip -j test.zip test/*
$ python3 test.zip
hello world
$

references

@indiecomarrow-up-right (backup)arrow-up-right

Last updated