Python Pickle Module
- Python’s pickle module is a serialization (converting the object into streams of bytes) library which is used to serialize the python objects.That means it can be used to encode and decode your functions, classes, dict, list, string etc,.
- Two important methods that pickle module provides are
`pickle.dumps`
and`pickle.loads`
.
What is pickle in python used for ?
- It is used for serializing and de-serializing a Python object structure. Any object in python can be pickled so that it can be saved on disk.
- What pickle does “serialises” the object before writing the file. Pickling is a way to convert a python object (list, dict, etc.) into a character stream.