So this is a code snippet from python doc to demonstrate multiprocessing module. I opened a empty file 'multi_process_test.py' and typed in these code.
from multiprocessing import Process
import sys
def f(name):
print('hello', name)
if __name__ == '__main__':
p = Process(target=f, args=('bob',))
p.start()
p.join()
And the weird part is if I run it under Spyder, the program prints nothing, but if I run the source code in powershell env by 'python multi_process_test.py', the console will prints 'hello bob' as expected, can s.b. help to explain why this happen? Or any hint to resolve this difference.
Appreciated for your help.