On Sun, Jan 25, 2009 at 4:21 PM, spir <denis.s...@free.fr> wrote:

> I take the opportunity to ask a question about module lookup. I was *sure* 
> that, when searching for a module, python automatically explores sub-folders 
> (both of the current folder and of the pathes listed in PYTHONPATH). But this 
> does not work by me (anymore):
> from ospyp.py, located in /home/spir/prog/ospyp, I cannot simply import 
> wikilang which is in /home/spir/prog/ospyp/samples

No, Python does not automatically search subfolders of directories in
PYTHONPATH. It will search package folders and subfolders if you ask
it to. For example if your samples folder includes a file __init__.py
(marking it  as a package) then you can import samples.wikilang.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to