Distutils question

Fernando Perez fperez528 at yahoo.com
Thu Jun 5 20:50:09 EDT 2003


Richard Muller wrote:

> I'm currently putting some python routines together in the form of a
> module using Distutils, and had a question I couldn't answer.
> 
> It seems that Distutils is set up so that python routines are either
> packages or scripts. I use many of my programs as both -- I want them to
> be in a place where I can import routines from them, but I also use them
> as interactive scripts.
> 
> Is there a simple way to do this within the framework of distutils? Up
> until now, I've just had may of these routines in a directory that is
> both in my PYTHONPATH and in my PATH.

standard solution: write very thin wrapper scripts (often one-liners) which call
your modules as scripts.  The side advantage is that the modules get
byte-compiled, so startup time is a bit reduced.

best,

f




More information about the Python-list mailing list