Suppose I have a module foo.py
and a package foo/
. If I call
import foo
which one will be loaded? How can I specify I want to load the module, or the package?
See Question&Answers more detail:osSuppose I have a module foo.py
and a package foo/
. If I call
import foo
which one will be loaded? How can I specify I want to load the module, or the package?
See Question&Answers more detail:osI believe the package will always get loaded. You can't work around this, as far as I know. So change either the package or the module name. Docs: http://docs.python.org/tutorial/modules.html#the-module-search-path