include in python

Peter Hansen peter at engcorp.com
Mon May 5 10:39:16 EDT 2003


Bartek Golenko wrote:
> 
[re splitting a large file into pieces that are then "included"]
> Well, the program I'm writting now is a prototype so it's going to be
> rewritten anyway, but right now I just want a convinient way to split
> the source code into smaller chunks.

I cannot strongly enough recommend against doing this.  If your prototype
is going to be so large that you feel it's inconvenient to work with it
in a single file, then it's certainly too large to manage in a single
namespace.

Save yourself a lot of hassle, listen to those who've gone there before,
and learn to use "import" properly right now, and you'll save yourself
a much greater inconvenience working with a hideously coupled design
and a style of programming that Python was not intended to handle.

-Peter




More information about the Python-list mailing list