threads instead od processes
Aahz
aahz at pythoncraft.com
Sun Jul 11 20:23:38 EDT 2004
In article <cc3uus$vs7$01$1 at news.t-online.com>,
Markus Franz <mail at markus-franz.de> wrote:
>
>I've got a little script:
>
>#!/usr/bin/python
>import sys, os
>for x in sys.argv[1:]:
> pid = os.fork()
> if pid == 0:
> # do something with x
> break
>
>This creates some new processes (depending on the number of passed command
>line arguments) and inside each process x is one command line argument.
>
>Now my question is: How can I do the same by using threads instead of
>processes?
Use the ``threading`` library module. Google for "python thread
tutorial" to find the many available.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"Typing is cheap. Thinking is expensive." --Roy Smith, c.l.py
More information about the Python-list
mailing list