import pickle mylist=[[1,2,3,4,5,6,7],["abc","xyz","hello"],[1,2,3,4,5,6,7,"我"]] file=open(r"G:我的python尹成python基础day11文件读写list.bin","wb") pickle.dump(mylist,file) # 保存list到文件 file.close() mylist = [] file = open(r"G:我的python尹成python基础day11文件读写list.bin","rb") mylist = pickle.load(file) # 读取文件到list print(mylist) file.close()