non-standard module location (again)

Shane gshanemiller at verizon.net
Fri Oct 21 10:05:32 EDT 2011


Need to refine a question I asked earlier. If I have a module,

|--  foo
|-------|
|-------|---bar
|-------|-------|
|-------|-------|---__init__.py

then I can say import foo.bar

But suppose I want to import foo.bar.stuff and stuff isn't located on
under `bar' because it's user
supplied code:

|- stuff                             <- I want this to be logically
under foo.bar
|-------|---__init__.py           <- even though it's not under bar in
the computer's file system

Now what: how to arrange to do command: import foo.bar.stuff



More information about the Python-list mailing list