标签:计算 nbsp tar col style imp def 通信 multi
import time from multiprocessing import Process,Event def f1(e): time.sleep(2) n = 100 print(‘子进程计算结果为‘,n) e.set() if __name__ == ‘__main__‘: e = Event() p = Process(target=f1,args=(e,)) p.start() print(‘主进程等待...‘) e.wait() print(‘结果已经写入文件了,可以拿到这值‘)
标签:计算 nbsp tar col style imp def 通信 multi
原文地址:https://www.cnblogs.com/work14/p/10267069.html