【发布时间】:2017-08-16 14:00:29
【问题描述】:
with open('data', 'w') as f:
pickle.dumps({'foo':111},f)
结果
an integer is required (got type _io.TextIOWrapper)
我该如何解决这个问题?
我很确定 An integer is required? open() 没有事先被调用。
Python版本为3.6.2
【问题讨论】:
-
Second argument to
dumpsisprotocol。你的意思是pickle.dumps({'foo':111},f)?
标签: python-3.x pickle