嵌套循环多进程
from multiprocessing import Pool import logging def log_conf(): logging.basicConfig( level=logging.DEBUG, format='{} {:<12}: {}'.format(('%(asctime)s'),('[%(levelname)s]'),('%(message)s')), filename='app1.log' ) def task(i,a): log_conf() result='task {}的循环数{}'.format(i,a) logging.info(result) if __name__=='__main__': log_conf() # logging.info('info') p=Pool(4) for i in range(10): for a in range(10,20): p.apply_async(task,args=(i,a)) p.close() p.join() print('主进程结束')