JSON and pickle modules (serialization and deserialization)

Source: Internet
Author: User

One, what is serialization (pickling):

The process of changing an object (variable) from memory into a storage or transfer is called serialization.

serialization can persist state without losing power to the computer or restarting the program, causing the previous data state to be lost. You can continue execution at the next time the program executes based on the state that was previously executed.

after serialization , you can interact across platform data. It breaks the limitations of platform/programming language differentiation, and it shows the interaction of data across platforms.

To put it simply:

Serialization: In-memory data structure---"into an intermediate format (string)---" stored in a file

In turn, the variable contents are reread from the object of the sequence into memory called deserialization (unpickling).

Deserialization: File------Read Intermediate format (string)-----"converted into in-memory data

The JSON and pickle of serialization: Application

Two modules for serialization

JSON is used to convert between string and Python data types

Pickle is used to convert between Python-specific types and Python data types

JSON and pickle modules (serialization and deserialization)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.