First page Back Continue Last page Overview Graphics

Threads as Demons

If a thread is supposed to run forever, it has to be made a daemon:

thread.daemon = True

thread.setDaemon(True)

The interpreter will lock, when the main thread exits, if you don't make the thread demonic, i.e. it will wait for the thread to finish!