多线程的使用:只能用cmd来玩不能用idle

from multiprocessing import Process
import os
 
def pro_do(name, func):
    print (6)
 
if __name__ == "__main__":
    print( "Parent process id %d" %(os.getpid()))
    pro = Process(target=pro_do, args=("test", "dev"))
    print ("start child process")
    
    pro.start()
    
    pro.join() 
    print ("Process end")

1.用idle来跑出不来6

2.用cmd.   命令:python 6.py

就能跑出来6.原因未知

posted on 2018-02-05 14:11  张博的博客  阅读(212)  评论(0编辑  收藏  举报

导航