Threading question

Jared Lee Peterson jared at tgflinux.com
Thu Apr 12 13:51:51 EDT 2001


I have a question regarding threading in python.  Let me start by saying
I am on a RedHat Linux 6.2 box with the standard python 1.5.2 that ships
with it.  I am writing a test script that I need to spawn various
threads.  I could probably do this without threads but I was curious to
see how they work in python so I am trying to get them working.
Basically I need to spawn a thread that is just making a system call
(os.system()) to another script.  However when I create the thread with
the target set it seems to call the other script just fine but the
thread blocks execution and does it does not resume in the first script
while that the other thread does it thing.  This is how I am spawning
the thread ...

tmp = Thread(target=os.system(other_script.py))

Ideally I want to be able to loop over a list of scripts and spawn
threads for each one and monitor their exectuion.  I have tried to look
online for docs on python threading and there are none so if someone
could help me out here that would be great.  It is probably obvious just
by my email that I am not the threading master for sure.  Thanks a lot

Jared





More information about the Python-list mailing list