mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-01-26 01:10:11 +01:00
19 lines
336 B
Python
19 lines
336 B
Python
from functools import wraps
|
|
from threading import Thread
|
|
|
|
|
|
def run_task(func):
|
|
""" Runs function in separate thread """
|
|
|
|
@wraps(func)
|
|
def wrapper(*args, **kwargs):
|
|
task = Thread(target=func(*args, **kwargs))
|
|
task.setDaemon(True)
|
|
task.start()
|
|
|
|
return wrapper
|
|
|
|
|
|
if __name__ == "__main__":
|
|
pass
|