多进程抓取猫眼电影+中文形式保存

def main():
pass
def write_to_file(content):
with open('result.txt','a',encoding='utf-8') as f:
f.write(json.dumps(content,ensure_ascii=False)*'\n')
f.close()
from multiprocessing import Pool
if __name__ == '__main__':
pool=Pool()
#构建了进程池,并运行了
pool.map(main,[i*10 for i in range(10)])

posted @ 2020-09-27 09:15  hisweetyGirl  阅读(176)  评论(0编辑  收藏  举报