[Tutor] can't import module
Alan Gauld
alan.gauld at freenet.co.uk
Sun Jul 2 21:12:36 CEST 2006
> As far a putting everything into a package - I am a bit lost. Do you
> mean one
> big .py script or am I misunderstanding you ?
You misunderstand him.
Python allows you to reate a package structure of directories and
files
such that all of the files within the top level directory and the
subdirectories
are searched so you only need to specify the top level directory for
all the
files in subndirectories to be found.
This requires creating some magic python definition files.
Check the docs for details.
The end result is that in pythonpath you add
/some/path/myPackage
and in your code you do
from myPackage import someModule
Check the docs for details.
Alan G.
More information about the Tutor
mailing list