Suppose I have a module foo.py and a package foo/. If I call
foo.py
foo/
import foo
which one will be loaded? How can I specify I want to load the module, or the package?
I 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
1.4m articles
1.4m replys
5 comments
57.0k users