mod mytimer test code to use an argument to the timed function

nanotube [2006-07-20 03:14]
mod mytimer test code to use an argument to the timed function
Filename
mytimer.py
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()
ViewGit