import threading
import time

class MyThread(threading.Thread):
    def run(self):
        print "%s started!" % self.getName()
        time.sleep(1)
        print "%s finished!" % self.getName()

if __name__ == '__main__':
    for x in range(4):
        mythread = MyThread(name = "Thread-%d" % x)
        MyThread().start()
        time.sleep(.2)

In SAGE Notebook:
Unhandled exception in thread started by <function myfunction at 0x2aaab81fe758>
TypeError: myfunction() takes at least 3 arguments (2 given)

In Python (Windows):
>>>
Thread-1 started!
Thread-2 started!
Thread-3 started!
Thread-4 started!
>>> Thread-1 finished!
Thread-2 finished!
Thread-3 finished!
Thread-4 finished!

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to