From 47b65a55282738ec2e047efea21e8b42f8b037b1 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Sun, 1 Nov 2020 15:48:59 -0600 Subject: [PATCH] Add run in thread --- source/easymacro2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/easymacro2.py b/source/easymacro2.py index 11ceb85..80dacea 100644 --- a/source/easymacro2.py +++ b/source/easymacro2.py @@ -291,6 +291,14 @@ def mri(obj): return +def run_in_thread(fn): + def run(*k, **kw): + t = threading.Thread(target=fn, args=k, kwargs=kw) + t.start() + return t + return run + + def now(only_time=False): now = datetime.datetime.now() if only_time: