Best method of saving data

前端 未结 5 1633
猫巷女王i
猫巷女王i 2020-11-28 12:16

I\'ve made a class in which I want to keep track of stats of students. I intend to make a GUI later to manipulate this data.

My main question is: what is the best wa

5条回答
  •  旧时难觅i
    2020-11-28 12:42

    You could use pickling, Python's serialization mechanism:

    The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a byte stream, and “unpickling” is the inverse operation, whereby a byte stream is converted back into an object hierarchy. Pickling (and unpickling) is alternatively known as “serialization”, “marshalling,” [1] or “flattening”, however, to avoid confusion, the terms used here are “pickling” and “unpickling”.

提交回复
热议问题