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

Brian Smith brian at briansmith.org
Sat Feb 16 18:39:48 EST 2008


Diez B. Roggisch wrote:
> Brian Smith wrote:
> > I would be interested in a program that can combine 
> > multiple modules into a single module, which removes
> > all the inter-package imports and fixes other
> > inter-module references, like Haskell 
> > All-in-One does for Haskell:
> > http://www.cs.utah.edu/~hal/HAllInOne/index.html
> 
> won't happen for python. python relies heavily on 
> modules/packages being namespaces.

So does Haskell. Haskell All-In-One handles that by renaming every
top-level artifact.

> Why would you want such a beast anyway? If it's about 
> single-file-distribution, that is solved by some of the above 
> mentioned tools - or even not desired anyway (say OS X bundles)

I want to package a complex WSGI application into a single CGI script,
so that users can copy the script into some CGI-enabled directory and
have it work without any further configuration, and so that it runs
faster (especially when the file is on NFS). If it is possible to run an
egg as a CGI (without modifying the web server configuration file), then
that would work as well.

- Brian




More information about the Python-list mailing list