One way to do it is to use the subprocess module
import subprocess as SP
child_process = SP.Popen(["python", "t.py"])
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
Not sure what your asking?
Do you mean you want to create:
1. a thread which exists in the current process
2. a new process which exists independently
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
multiprossessing is a standard module for python >= 2.6. For older versions, you must download pyprocessing.
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
i downloaded pyprocess. installed an=d got error:
'module' object has no attribute 'f'
post your code
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
gribilus, overclock's code:
from multiprocessing import Process
def f(name):
print 'hello', name
if __name__ == '__main__':
p = Process(target=f, args=('bob',)) #inits thread
p.start() #starts thread
p.join() #waits untill thread is done
On my machine it works well with python 2.6.
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691