Files
daun/modules/thread.py
2022-04-10 13:23:00 +03:00

12 lines
266 B
Python

# Module to easily create threads
import threading
def threaded(func):
"""
Decorator to start a function in a new thread
"""
def thr(*args, **kwargs):
threading.Thread(target=func, args=(*args,), kwargs={**kwargs, }).start()
return thr