Is pickle file of python cross-platform?

前端 未结 6 1768
攒了一身酷
攒了一身酷 2020-11-28 12:54

I have created a small python script of mine. I saved the pickle file on Linux and then used it on windows and then again used it back on Linux but now that file is not work

6条回答
  •  粉色の甜心
    2020-11-28 13:18

    Pickle should be cross-platform, there are versioning/protocol issues, (see http://docs.python.org/library/pickle.html#data-stream-format) but in general if you're using the same release of python on your windows and unix boxes, they should be interoperable.

    If you're using pickle as a data transport mechanism, you might want to consider less-implementation specific formats for data storage, such as json, xml, csv, yaml, etc.

提交回复
热议问题