mirror of
https://github.com/Cian-H/Melter.git
synced 2025-12-22 14:11:59 +00:00
15 lines
342 B
Python
15 lines
342 B
Python
#!/usr/bin/env python3
|
|
# *_* coding: utf-8 *_*
|
|
|
|
from threading import Thread
|
|
from functools import wraps
|
|
|
|
|
|
# Wrapper for running a function in a parallel thread
|
|
def run_in_thread(func):
|
|
@wraps(func)
|
|
def wrapper(*args, **kwargs):
|
|
thread = Thread(target=func, args=args, kwargs=kwargs)
|
|
thread.start()
|
|
return wrapper
|