def run_in_subprocess(func, *args, **kwargs):
 from multiprocessing import Process
 thread = Process(target=func, args=args, kwargs=kwargs)
 thread.daemon = True
 thread.start()
 return thread

def run_in_subprocess ( func , * args , ** kwargs ) : from multiprocessing import Process thread = Process ( target = func , args = args , kwargs = kwargs ) thread . daemon = True thread . start ( ) return thread
run function in subprocess .