What is pickle in python?

Pickle is a standard Python library that handles serialization – that is, a way to take variables that are otherwise stored in memory, and output them in a format that can be stored to a file and read from later.
In easy words we can say that pickle is a module which helps to modulate the file selected in a python friendly way so that python can easily work on it.
We can easily import it and use it.
Syntax:-
import pickle
As we do in file handling we can do it in this also. We can read data, write data and modify it. It has some special functions like pickle.loads(), pickle.dumps(), etc.
We can pickle object of following data types.
- Boolean
- Lists
- Tuples
- Integer and floats
- Strings
- Complex numbers
- Dictionaries(which has picklable object)
This is all about pickle library in python.
Subscribe
Login
Please login to comment
0 Discussion