Pickling

In this lesson, you'll learn how to pickle and unpickle objects in Python.

Introduction to serialization

Serializing (sometimes called marshalling) an object turns it into a linear stream of bytes. This can be done to save an object on a file, or to transmit it to another process. The byte stream can be deserialized (unmarshalled) to reconstruct the original object.

The most common way to serialize Python objects is called pickling. Python can also use JSON and XML for serialization.

Get hands-on with 1400+ tech skills courses.