One of common question of python programming is how to do jar equivalent - i.e. run something like python . Below I describe a method producing a close result (hey python team - good place to enhance): unfortunately couple of bugs in python zip handling (e.g. python can't import module from zipfile with comments) make this task a little bit tricky.

  1. Make sure you app is ready to work with zip bundle i.e. file is replaced to ZipFile when necessary.
  1. Prepare the entry point:
    def __main__():
  1. create a bundle
    zip -r *.py *.pyc
  1. create a launcher either shell or pure python one and place it somewhere.
python -c "import sys; sys.path.insert(0,'${mod}'); import main;main.__main__()" $*
import sys
import main