Application Packages
Dj Gilcrease
digitalxero at gmail.com
Tue Sep 15 20:29:59 EDT 2009
when looking up namespace-packages I found pkgutil which lets me add a
myapp.user package with the following in its __init__.py and nothing
else
import os, os.path
from pkgutil import extend_path
homedir = os.environ.get('HOME') or os.environ.get('USERPROFILE')
__path__ = extend_path([os.path.abspath(homedir + os.sep + 'myapp')], __name__)
now I can do "from myapp.user.plugins import *" and it works
More information about the Python-list
mailing list