def run_in_thread(func, *args, **kwargs):
 from threading import Thread
 thread = Thread(target=func, args=args, kwargs=kwargs)
 thread.daemon = True
 thread.start()
 return thread

def run_in_thread ( func , * args , ** kwargs ) : from threading import Thread thread = Thread ( target = func , args = args , kwargs = kwargs ) thread . daemon = True thread . start ( ) return thread
run function in thread .