[Tutor] directory as package

Kermit Rose kermit at polaris.net
Thu Jun 8 14:59:24 CEST 2006


 
Message: 4
Date: Wed, 7 Jun 2006 20:10:52 -0700
From: Dave Kuhlman <dkuhlman at rexx.com>
Subject: Re: [Tutor] module versus file
To: tutor at python.org
 
Hello Dave.
 
 
>>>>>>>>>>
 
If you are importing a module from a directory other than your
current directory, then the directory is effectively a package.
In order to make a directory into a package, the directory must
contain a file named __init__.py.
 
The file __init__.py can be empty or can contain code.  It will be
evaluated the first time (and only the first time) an application
imports the package or something in it.
 
Dave
 
*******
 
It must  be someother method that I used, because
 
there is no file named _init_.py is directory math\factoring
 
 
Is it that the convention must be different for a windows machine?
 
C:\Math\Factoring>dir *init*
 Volume in drive C has no label.
 Volume Serial Number is 4748-654D
 
 Directory of C:\Math\Factoring
 
File Not Found

 
Kermit    <  kermit at polaris.net  >
 
 
 



More information about the Tutor mailing list