Sebastian "Marduk" Pölsterl wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

nephish schrieb:
OK
i looked at the docs in the link.
does this mean i set up every thread (i need to run four) as its own
subclass of threading.thread?
and call it like that?
Exactly.
You write your class:
class MyThread(threading.Thread):
        def __init__(self):
                threading.Thread.__init__(self)
        def run(self):
                # Your process running as thread

and then call:
mythread = MyThread()
mythread.start()

with mythread.isAlive() you can check if your thread is finished

the examples i have seen so far just set it as a function and then call
the function with threading.Thread.start(function())
maybe i am missing something in the terminology.
thanks for the reply by the way.

I only know this procedure from Thread.start_new_thread()
See http://docs.python.org/lib/module-thread.html for more detail.

- --
Greetings,
Sebastian Pölsterl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDHxNq1ygZeJ3lLIcRAtwHAKCQWVFP9rhyhA/8HBQo8k2REcEvAgCeOFn0
ue3aHcmBvP54QeA0orim3Hg=
=Wd6V
-----END PGP SIGNATURE-----
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

ok, i shouldnt need the isAlive part. what should happen when all this works
is that the thread reads some info from the serial port, processes it, and writes
it to a textview.
is the writing part needed to be seperated from the run function of MyThread?

thanks
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to