[Tutor] import and unittest

Kent Johnson kent37 at tds.net
Wed Jan 17 14:11:59 CET 2007

Thomas Coopman wrote:
> When I run One.py from in the directory A, doesn't look python in it's 
> parent directory when it can't find the module?
> And if that's not the case where and what should I add to the sys.path 
> variable?

No, Python won't look in parent directories for imports. Try running 
One.py from the parent dir of M by typing
 > python M/A/One.py

or add the parent dir of M to sys.path.


More information about the Tutor mailing list