fork download
  1.  
  2. import multiprocessing
  3.  
  4. res = []
  5.  
  6. def calculation(numbers):
  7. print("here")
  8. global res
  9. for n in numbers:
  10. res.append(n*n)
  11. print("inside the process"+str(res))
  12.  
  13.  
  14. if __name__ == "___main__":
  15. nums = [1,2,3]
  16. print("dsafa")
  17. p1 = mutltiprocessing.Process(target=calcultation, args=(nums,))
  18. p1.start()
  19. p1.join()
  20.  
  21. print("outside"+str(res))
Success #stdin #stdout 0.02s 8316KB
stdin
Standard input is empty
stdout
Standard output is empty