第1个回答 2017-05-18
import pickle
with open('hello.txt', 'r') as fr:
data = fr.read()
print(data)
with open('data.pickle', 'wb') as fw:
pickle.dump(data, fw, pickle.HIGHEST_PROTOCOL)
with open('data.pickle', 'rb') as fr:
data = pickle.load(fr)
print(data)本回答被提问者和网友采纳