Python program organization

Fuzzyman michael at foord.net
Mon Feb 23 08:31:21 EST 2004


Derek W <whitedw at NOSPAMcox.net> wrote in message news:<40385A13.6090904 at NOSPAMcox.net>...
> François Pinard wrote:
> 
> > [Derek W]
> > 
> > 
> >>Is it proper to break the program up into modules and put all of the
> >>modules in a package even if the modules would be of little or no use
> >>to others (such as the program specific GUI code)?
> > 
> > 
> > Hi, Derek.  It looks proper to me.  You might want to break a big
> > package into sub-packages, but all of it usually goes into a single
> > directory hierarchy.
> > 
> > 
> >>Would this package then go under Python's site-packages directory when
> >>the program is installed?
> > 
> > 
> > This is the most natural thing to do.
> > 
> > 


I disagree - if your program is an application it would be more normal
to put it in it's own directory in 'Program Files' - or whereever the
user specifies - rather than buryaing it somewhere in your python
distribution.

It's much better to save that directory for 'general' modules that are
going to be reused.

If all your 'modules' are in the same directory as the application
then python will import them fine wherever you put them.

Regards,

Fuzzy

http://www.voidspace.org.uk/atlantibots/pythonutils.html

> >>Would distribution of a program like this use distutils?
> > 
> > 
> > Why not? :-)
> > 
> 
> François,
> 
> Thank you for replying to my post.  I very much appreciate your input. 
> Great homepage by the way.
> 
> Thanks again,
> Derek



More information about the Python-list mailing list