对于序列化最普遍的做法就是使用 pickle 模块。为了将一个对象保存到一个文件中,可以这样做:. import pickle data = ... # Some Python object f = open('somefile', ...
確定! 回上一頁