def spawn_thread(func, *args, **kwargs):
    """Spawns a daemon thread."""
    thread = threading.Thread(target=func, args=args, kwargs=kwargs)
    thread.daemon = True
    thread.start()
    return thread
Spawns a daemon thread.