老师您好!我用的是python3.7,学到这里总是报错:
Traceback (most recent call last):
File "C:/Users/Laotianpeng/Desktop/pythonlearn/t1.py", line 4, in <module>
pickle.dump(test_data,f)
TypeError: write() argument must be str, not bytes
我的代码是:
import pickle
test_data=["Save me !",'123.456',True]
with open('somefile.data','w') as f:
pickle.dump(test_data,f)