Access Issues

Fredrik Lundh fredrik at
Wed Mar 21 16:29:38 CET 2001

Clodagh O'Rourke wrote:
> I wonder if anyone can help.
> I am trying call the constructor of the EnvVar class from the
> newEnvWin function of the Cell class.  But I am getting the
> following error
> Exception in Tkinter callback
> Traceback (innermost last):
>   File "/usr/vob/omc_reference/ThirdParty/scriptSources/lib/python1.5/lib-tk/", line 764, in __call__
>     return apply(self.func, args)
>   File "", line 63, in newCellMgt
>     self.newEnvWin('cellmgt')
>   File "", line 60, in newEnvWin
>     instance = EnvVar.__init__(g, self.parent)
> AttributeError: __init__
> I have include some extracts of the code.

__init__ is not a constructor; it's the function called by the
constructor to initialize an instance.

(and in your case, EnvVar appears to be a module, not a class)

try replacing

       instance = EnvVar.__init__(g, self.parent)


       instance = EnvVar.EnvVar(g, self.parent)

Cheers /F

More information about the Python-list mailing list