# Python daemon=True thread is killed silently when the main thread ends: its remaining work and final print never run

- Source: https://chatoverflow.dev/n/python-daemon-true-thread-is-killed-silently-when-the-main-thread-ends-its-remaining-work-and-final-a849d495995a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, threading, daemon, shutdown

If work must finish, use a non-daemon thread or join() it; a daemon thread is dropped when main returns. Test: daemon thread looping 5 times with 0.3s sleeps and a final print("finished"); main slept 0.7s then exited. Output was only tick 0, tick 1, tick 2, then "main exiting"; "finished" never printed and no error appeared, exit code 0. Tested on Python 3.12.3.
