From 2b6537104d99b99a21f74185e836ef08a9e1a204 Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Sat, 6 Oct 2012 01:34:06 +0200 Subject: [PATCH] callAt helper added --- brathuhn.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/brathuhn.py b/brathuhn.py index 360993c..3a4b650 100644 --- a/brathuhn.py +++ b/brathuhn.py @@ -255,5 +255,12 @@ def loop(): time.sleep(s) connect_and_join() print "---------------------------" - +def callAt(func,_time,*args): + s=time.time()-_time + def run(): + if s>0: + time.sleep(s) + func(*args) + threading.Thread(target=run).start() +