From d4cc925923664349643193e919f65a340daab9e9 Mon Sep 17 00:00:00 2001 From: nanotube Date: Thu, 20 Jul 2006 03:14:25 +0000 Subject: [PATCH] mod mytimer test code to use an argument to the timed function --- mytimer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mytimer.py b/mytimer.py index 581c227..c5f6d40 100644 --- a/mytimer.py +++ b/mytimer.py @@ -40,15 +40,15 @@ class MyTimer(Thread): if __name__ == '__main__': #some test code here. - def hello(): - print "hello dude" + def hello(name="bla"): + print "hello, ", name - myt = MyTimer(1.0, 5, hello) + myt = MyTimer(1.0, 5, hello, ["bob"]) myt.start() time.sleep(4) myt.cancel() print "next timer" - myt = MyTimer(1.0, 0, hello) + myt = MyTimer(1.0, 0, hello, ["bob"]) myt.start() time.sleep(6) myt.cancel() -- 2.45.1