Creating Thread's in python

Posted by chrissygormley on Stack Overflow See other posts from Stack Overflow or by chrissygormley
Published on 2010-05-25T15:15:01Z Indexed on 2010/05/25 15:21 UTC
Read the original article Hit count: 270

Filed under:
|

Hello,

I have a script and I want one function to run at the same time as the other.

Example code I have looked at:

import threading


def MyThread ( threading.thread ):

  doing something........

def MyThread2 ( threading.thread ):

  doing something........

MyThread().start()
MyThread2().start()

I am having trouble getting this working. I would prefer to get this going using a threaded function rather than a class.

Thanks for any help.

© Stack Overflow or respective owner

Related posts about python

Related posts about threading