Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import multiprocessing as mp
- print("start")
- def f1():
- print("f1")
- def f2():
- print("f2")
- if __name__=="__main__":
- print("start if")
- p1=mp.Process(target=f1)
- p2=mp.Process(target=f2)
- p1.start()
- p2.start()
- print("end if")
- print("end")
- #output
- """start
- start if
- end if
- end
- start
- end
- f2
- start
- end
- f1"""
Advertisement
Add Comment
Please, Sign In to add comment