I'm wondering because i'm having some massive issues with importing package modules into my embedded python enterpreter, regardless of sys.path .
so for example.
my package.
program.py
lib|
Packz|
- __init__.py
- a.py
- b.py
program.py importing functions like
from Packz.a import afunc
from Packz.b import bfunc
Is it possible to flatten this package to completely remove the directory the module resides in and place all the lib files in the same directory?? ( providing that the module names don't collide of course)
program.py
lib|
Packz.py
a.py
b.py
WHile still maintain the ability to import like this from my main program:
from Packz.a import afunc
from Packz.b import bfunc
could I do something like:
Packz.py>
import a
import b
any thoughts on the subject?
i've got a virtual filesystem that seems to have trouble loading in the module if it's referenced by it's directory name. the main program does "see" the files in all the directories though and i can import regular single file modules. such as io.py timeit.py
i've tried importing my module with the python c api to no avail. i'm on python 2.6 so i cannot use import to import a module with a path. ( only 2.5 and below, seems like it was bug)
Thanks!