Restarting a thread in Python
问题 I'm trying to make threaded flight software for a project in Python 3.4, in which I need threads to restart themselves in case an I/O error occurs during a sensor read or another fluke crash like that. Therefore I am working on making a watchdog to check if threads have died and restarting them. At first I attempted to just check if the thread was no longer alive and restart it, which did this: >>> if not a_thread.isAlive(): ... a_thread.start() Traceback (most recent call last): File "<stdin