Files
pide/script/test/test_proc.py
2022-08-24 14:20:58 +02:00

20 lines
446 B
Python

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