Newbie having issues with threads

James Calivar amheiserbush at yahoo.com.au
Fri Aug 1 08:45:55 EDT 2008


Well, that seemed to do the trick.  Thanks for the tip!  I guess as a
novice and having no investment in the older "thread" module, I'll
just use the Threading module from now on.

James
=====

PS Here is my new code snippet:
=====

#!/usr/bin/python

import threading

class Test(object):
    def __init__(self, instanceID):
        self.instanceID = instanceID
    def configure(self):
        print self.instanceID + " configuring..."
    def execute(self):
        print self.instanceID + " executing..."
    def halt(self):
        print self.instanceID + " halting..."

class testThread(threading.Thread):
    def __init__(self, ID):
        self.ID = ID
        threading.Thread.__init__(self)
    def run(self):
        ua1.execute()

if __name__ == "__main__":
    """usage: sipp_auto [options]"""

    ua1 = Test("UA_1")

    ua1.configure()

    thread = testThread("UA_1")
    thread.start()
    thread.join()

    ua1.halt()



More information about the Python-list mailing list