I'm trying to save a list, only containing strings, so it can be accessed later. Someone told me to use pickling. I was hoping for an example and some understanding of what pickling is.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Pickling will serialize your list (convert it, and it's entries to a unique byte string), so you can save it to disk. You can also use pickle to retrieve your original list, loading from the saved file.
So, first build a list, then use
pickle.dump
to send it to a file...Then quit and come back later… and open with
pickle.load
...