import error?

Tom llafba_NOSPAM_ at gmx.net
Thu Oct 16 09:11:16 EDT 2003


Peter Hansen wrote:

>Is there a complete trackback you could post?  Then nobody would
>have to guess what your problem is.
>
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "C:\Test\TestAnaMod.py", line 103, in ?
    mul.multi(ActualState, Data, d, BoundModels, Automat, LogName)
  File "C:\Test\multi_C.py", line 102, in multi
    ReIni = initialize_C()
NameError: global name 'initialize_C' is not defined

At the very beginning of the module I include the other module which has 
the class  initialize_C. This is not the only time I refere to another 
module and its class and functions. But it is the only time I get an 
error. But I have no typos in the code. Strangewise I can call the 
module with the class initialize_C from another module without causing 
any problems!??! The weird thing is, that I have this at the beginning 
of my module "from IniMod import *" (this is the module that has the 
class initialize_C) and it doesn't work. But if I cut this line and 
paste it into line 101, it works perfectly. Why is that? If I include it 
at the very beginning of my module, shouldn't it be valid for the entire 
module? If I import the module in line 101 I get this little warning 
saying that I should import this at the beginning of the module, but it 
works at least. :-)

I hope this helps to clear things up and you guys can help me. I am 
quite confused right now.
Thanks for your help, Tom





More information about the Python-list mailing list