easy save/load of data in python

前端 未结 7 1378
小蘑菇
小蘑菇 2020-12-28 09:35

What is the easiest way to save and load data in python, preferably in a human-readable output format?

The data I am saving/loading consists of two vectors of floats

7条回答
  •  遥遥无期
    2020-12-28 10:06

    • If it should be human-readable, I'd also go with JSON. Unless you need to exchange it with enterprise-type people, they like XML better. :-)

    • If it should be human editable and isn't too complex, I'd probably go with some sort of INI-like format, like for example configparser.

    • If it is complex, and doesn't need to be exchanged, I'd go with just pickling the data, unless it's very complex, in which case I'd use ZODB.

    • If it's a LOT of data, and needs to be exchanged, I'd use SQL.

    That pretty much covers it, I think.

提交回复
热议问题