Python Tutorial on Multithreading
kvnsmnsn at hotmail.com
Mon Feb 21 19:02:11 EST 2011
On Feb 21, 4:04 pm, Alexander Kapps <alex.ka... at web.de> wrote:
> That tutorial seems to be wrong.
> According to the official docs:
> "If the subclass overrides the constructor, it must make sure to
> invoke the base class constructor (Thread.__init__()) before doing
> anything else to the thread."
> So, change your __init__ to this:
> class myThread (threading.Thread):
> def __init__(self, threadID, name, q):
> self.threadID = threadID
> self.name = name
> self.q = q
Alexander, thanks! Your suggestion fixed my problem.
More information about the Python-list