[Tutor] Calling class from another class
aishwarya selvaraj
aishwaryaselvaraj1708 at gmail.com
Tue May 22 06:16:50 EDT 2018
Dear all,
I have created 2 classes in 2 separate files.File 1 named atcore_py.pyx
with class andorCameraSDK3, and file 2 with name AndorCameraGUI making use
of TKinter.
I was able to import andorCameraSDK3 into AndorCameraGUI, but I was not
able to do the other way around, as I need to call the function Plot() in
file 2 inside function acquireimage() in file 1.
When I define self.master = master in file 1 and pass this from file 2 as
self.camera = andorCameraSDK3(self) , I get an error saying :
> Exception in Tkinter callback
>
Traceback (most recent call last):
>
File "/home/ravindra/anaconda2/lib/python2.7/lib-tk/Tkinter.py", line 1541,
> in __call__
>
return self.func(*args)
>
File "/home/ravindra/PycharmProjects/LiveMode/GUI.py", line 278, in
> getCameraStringGU
>
self.camera = AndorCameraSDK(self)
>
File "atcore_py.pyx", line 77, in AndorCameraDriver.
> andorCameraSDK3.__cinit__
>
self.master = master
>
AttributeError: 'AndorCameraDriver.andorCameraSDK3' object has no attribute
> 'master'
>
Process finished with exit code 0
>
>
I'm attaching both the files along with this email. It would be great if
someone could help me out here. Thanks in advance
--
Regards,
Aishwarya Selvaraj
ᐧ
More information about the Tutor
mailing list