How to build a single python file from multiple scripts?

I found this useful:

In short, you can .zip your modules and include a file inside, which will enable you to run it like so:


Since my app is small I made a link from my main script to


You can also make the zip self-executable on UNIX-like systems by adding a single line at the top of the file. This may be important for scripts using Python3.

echo '#!/usr/bin/env python3' | cat - > app
chmod a+x app

Which can now be executed without specifying python


Leave a Comment