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 executable.

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

references

@indiecom (backup)

Last updated

Was this helpful?