1,copy模块 from copy import deepcopy dic = {} list = [] for i in range(10): dic["num"] = i if i == 0: pass else: dic001 = deepcopy(dic) if i == 9: j = 0 while j <= 1: list.append(dic001) j += 1 else: list.append(dic001) print(list) 代码运行的结果: 单例模…
python高级之多进程 本节内容 多进程概念 Process类 进程间通讯 进程同步 进程池 1.多进程概念 multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency,effectively side-…