Script execution
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
p = mp.Process(target=f, args=('bob',))
|
||||
p.start()
|
||||
print ("STARTED")
|
||||
p.join()
|
||||
print ("JOINED -> ", p.exitcode)
|
||||
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)
|
||||
Reference in New Issue
Block a user