Import w/ '.' syntax
jeff at jmcneil.net
Fri May 15 17:20:17 CEST 2009
On May 15, 10:50 am, mrstevegross <mrstevegr... at gmail.com> wrote:
> Remind me: is it possible to craft an import statement like this:
> import foo.bar
> If so, what's going on here exactly? Is Python looking for a module
> called 'bar', in a directory called 'foo', in a search path somewhere?
> Or am I totally misunderstanding the import semantics.
In that specific case, you're looking for a module 'bar' in the 'foo'
package, which should be located somewhere on sys.path.
That covers it pretty well.
More information about the Python-list