I have a python script that I call with python main.py
on my terminal. It starts the Qt-GUI, which runs correctly and exits when I close the GUI.
However, sometimes the last debug message "over and out" is displayed, but the script itself does not end. Neither ctrl + c , ctrl + d , nor ctrl + z affect execution. It seems to me that this happens when an exception was thrown inside the program (and got into the GUI).
I donβt know how to debug this, since this is clearly not happening in the GUI itself. How do I debug this and find out what I did wrong?
if __name__ == '__main__': import sys app = QApplication(sys.argv) form = MainGui() form.show() app.exec_() print "over and out"
EDIT: It seems to me that there is some kind of thread at the end. However, I do not understand how to work with the stream (I do not know what Qt does internally ...). Is there a way to view all running threads at the end?
EDIT2: Oh my god. The solution just restarted my system. Somehow, my OS did some crazy things and prevented the script from shutting down.
source share