I just want to run an example from this site which is the following code:
from multiprocessing import Process
def square(x):
for x in numbers:
print('%s squared is %s' % (x, x**2))
if __name__ == '__main__':
numbers = [43, 50, 5, 98, 34, 35]
p = Process(target=square, args=('x',))
p.start()
p.join()
print ("Done")
it says that if you run the code, you should see the following results:
#result
Done
43 squared is 1849
50 squared is 2500
5 squared is 25
98 squared is 9604
34 squared is 1156
35 squared is 1225
But as I run this code, I just see Done
in results and nothing more. In that Tutorial used Python 2.7 but I have 3.6 and I added ()
in prints.
Thank you for your help