Files
pide/script/test/test_proc.py
2022-08-24 13:47:59 +02:00

20 lines
451 B
Python

import time
print ("ENTER")
def f(name):
time.sleep(5.0)
print ("Enter")
with open('/Users/gobbo_a/readme.txt', 'w') as f:
f.write('hello' )
print('hello', name)
if __name__ == '__main__':
ctx = mp.get_context('spawn')
q = ctx.Queue()
p = ctx.Process(target=f, args=('bob',))
#p = mp.Process(target=f, args=('bob',))
p.start()
print ("STARTED")
p.join()
print ("JOINED -> ", p.exitcode)