Calling class from another class having Tkinter in cython

59 views
Skip to first unread message

aishwarya selvaraj

unread,
May 22, 2018, 6:03:03 AM5/22/18
to cython...@googlegroups.com
Dear all, 
I have been using cython in my code. I have created 2 classes in 2 separate files.File 1 named atcore_py.pyx with class andorCameraSDK3, and file 2 with name  AndorCameraGUI. 
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 


Im 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
atcore_py.pyx
GUI.py
Reply all
Reply to author
Forward
0 new messages