Is there a way to "link" a python program from several files?

Diez B. Roggisch deets at nospam.web.de
Sat Feb 16 14:16:00 EST 2008


Edward A. Falk schrieb:
> IOW, is there a "linker" for python?  I've written a program comprised of about
> five .py files.  I'd like to find a way to combine them into a single
> executable.  Obviously, I could hand-edit them into a single .py file, but
> I'm looking for a way to keep them as seperate files for development but
> distribute the result as a single file.
> 
> If this were C, I'd compile and link them and distribute the resulting
> executable.  I'm trying to do that, but for Python.

Depending on the OS, there are several options. Ranging from 
distributing an .egg (setuptools) over py2exe for windows to py2app on 
OSX - and some more, e.g. cx_freeze.

Google for one of the above.

Diez



More information about the Python-list mailing list