Big problem fetching members from dynamically loaded module
__peter__ at web.de
Sun Jun 26 08:45:54 CEST 2005
Philippe C. Martin wrote:
> Any clue would be quite welcome.
I didn't recognize the pattern in the code you posted, but sometimes the
order of imports matters:
$ find .
Python 2.3.3 (#1, Feb 5 2005, 16:22:10)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from package.beta import *
>>> from package import *
>>> from package.alpha import *
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'alpha' is not defined
<module 'package.beta' from 'package/beta.py'>
The 'right' way to do the imports if you want both 'alpha' and 'beta' is of
from package import alpha
from package import beta
More information about the Python-list