def create_and_start_daemon_thread(target): thread = Thread(target=target) thread.error = None thread.daemon = True thread.start() return thread