2 years ago
#30980
Pepsi-Joe
Is there a way to catch any and all errors that may be thrown using tkinter?
I am writing a GUI that interfaces with i2c sensors via USB. As a result, an error could be thrown at any stage if something happens to the sensor (e.g. something shorts due the sensors still being on a breadboard in development).
As it stands, if there is an error, the kernel will crash, but there is no indication to the user that the program has crashed (other than in the terminal running the python script) and you can still interact with the GUI but nothing actually happens.
I would like the program to automatically exit (or at least warn the user) when an error is thrown and execution is interrupted. Is there a nice way of doing this that doesn't involve including a try
block in every operation involving the interface with the USB?
python
tkinter
adafruit-circuitpython
0 Answers
Your Answer