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()
print(p,type(p))
这个程序在我的电脑上没有正常执行......但是使用在线编译器它可以正常工作
====================== RESTART: E:\Python\py_prac_9.py ======================
<Process(Process-1, stopped[1])> <class 'multiprocessing.context.Process'>
>>>
预期输出:
====================== RESTART: E:\Python\py_prac_9.py ======================
hello bob
<Process(Process-1, stopped[1])> <class 'multiprocessing.context.Process'>
>>>
我正在使用带有3.5.4 python版本的Windows 8.1 ...
Environmental Variables:
PATH:
C:\Users\Madhu G\AppData\Local\Programs\Python\Python35-32\;
C:\Users\Madhu G\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\;
C:\Users\Madhu G\AppData\Local\Programs\Python\Python35-32\Scripts\;
请建议我解决方案,即使守护进程没有正确执行......我是否需要对我的电脑进行任何更改..