How can I package a python script and modules into a single script?

Thomas Heller theller at python.net
Thu Nov 3 10:18:35 EST 2005


"Noah" <noah at noah.org> writes:

> I would like to package my main script and all the
> modules it imports into a single script that will
> run just as the collection would. It should not
> need to package standard Python lib modules -- just
> my local modules. This is not the same question
> that would be answered with py2exe or py2app. I
> don't need to package the script into a binary
> along with Python. I expect Python to be installed.
> I also don't want to use distutils to install the
> script. The script will always run on Unix.
>
> I thought that there might be some way to run a
> script package from a tar file. One way would be to
> have the package script  untar itself into a temp
> directory; run the main script; then  delete the
> temporary package directory when done. That sounds
> clunky and prone to leave around trash if someone
> does a 'kill -9'. However, this might be an
> acceptable compromise. I'm sure that I've seen a
> tool around like this, but I can't find it anymore.

Wasn't this named 'squeeze'?

Thomas



More information about the Python-list mailing list