用pickle保存中间变量:
with open('path/file_name.pickle', 'wb') as handle:
pickle.dump(variable_name, handle, protocol=2)
用pickle读取中间变量:
with open('path/file_name.pickle', 'rb') as handle:
variable_name=pickle.load(handle)
用pickle保存中间变量:
with open('path/file_name.pickle', 'wb') as handle:
pickle.dump(variable_name, handle, protocol=2)
用pickle读取中间变量:
with open('path/file_name.pickle', 'rb') as handle:
variable_name=pickle.load(handle)