Alex_Cai 发表于 2020-10-9 16:04:23

pickle报EOFError: Ran out of input

import pickle

my_list = ]

pickle_file = open('my_list.pkl','wb')
pickle.dump(my_list,pickle_file)
pickle_file.close

pickle_file1 = open('my_list.pkl','rb')
my_list2 = pickle.load(pickle_file1)
print(my_list2)

将pickle_file = open('my_list.pkl','rb') 改为pickle_file1 = open('my_list.pkl','rb')为什么会报错EOFError: Ran out of input

冬雪雪冬 发表于 2020-10-9 16:39:41

pickle_file.close()
页: [1]
查看完整版本: pickle报EOFError: Ran out of input