Category: threading

Problem

Run background thread that exits with main.

Solution

  t = threading.Thread(target=worker, daemon=True); t.start()
  

Notes

  • Adapt variable names and paths to your project
  • Add error handling for production use
  • See related chapters in the Learning Path