George Sakkis wrote:
> Is it possible to start a new process by specifying a function call
> (in similar function to thread targets) instead of having to write
> the function in a separate script and call it through os.system or
> os.spawn* ? That is, something like
>
> def foo(): pass
> os.spawn(foo)
Just starting is easy:
def spawn(f):
if os.fork() == 0:
f()
sys.exit(0)
But I'd expect you would like to get some return values from f...
Mathias
--
http://mail.python.org/mailman/listinfo/python-list