import confused by contents of working directory

Fredrik Lundh fredrik at pythonware.com
Fri Jun 2 13:32:14 CEST 2006


"Jon" wrote:

> Would somebody please explain how to know what is going on when an
> import statement is ambiguous?

there is no ambiguity: python searches through a list of directories, in a given
order.

the list is stored in the sys.path list, which you can inspect and modify freely.

also see the section "The Module Search Path" in the Modules chapter in the
tutorial:

    http://pytut.infogami.com/node8.html

> If the interpreter has several choices about what to import then which one is
> chosen?

the first one on the path.

</F> 






More information about the Python-list mailing list