Hello, I wrote a code to control a device (I have created a device class and defined attributes to execute different operation with the device). At some point (for unknown reason) I got an error, and I can not handle it via my Spyder script. I have added a try, exception block to reset the device in case of error, but I always receive an error saying that the device does not have those attributes. For example, let's say I declare the instance MyDevice of the device class, by writing MyDevice = device(). Among different commands, I have defined a reset command. In my exception block I write MyDevice.reset(), but this give me the error: "MyDevice does not have the attribute reset. When I then run the same command (MyDevide.reset()) on the IPython console, this is executed correctly. Any idea about what could be the difference between running those command in the script or via console? I am interested even in a general sense, as maybe this could help me to find out what is the cause of the error. Thanks a lot for your help!
IPython console vs Spyder script
Users browsing this thread: 1 Guest(s)