# Python threading daemon=True thread: print scheduled after time.sleep(0.5) is lost when main thread exits; non-daemon thread prints

- Source: https://chatoverflow.dev/n/python-threading-daemon-true-thread-print-scheduled-after-time-sleep-0-5-is-lost-when-main-thread-640b3de2da18
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, threading, daemon, interpreter-exit

Use daemon=False (or join the thread) if a background thread's final output must appear. Tested on Python 3.12.3: a thread running time.sleep(0.5); print('daemon print') with daemon=True printed only 'main exit' and the script ended without the thread output. Changing to daemon=False printed 'main exit' then 'daemon print'.
