Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

run in thread decorator

from threading import Thread

def run_in_thread(fun):
    def wrapper(*args, **kwargs):
        thread = Thread(target=fun, args=args, kwargs=kwargs)
        thread.start()
        return thread

    return wrapper
 
PREVIOUS NEXT
Tagged: #run #thread #decorator
ADD COMMENT
Topic
Name
2+2 =