Python Design Patterns Tutorial
Python Design Patterns Resources
Selected Reading
- Exception Handling
- Python Design Patterns - Anti
- Concurrency in Python
- Strings & Serialization
- Python Design Patterns - Queues
- Python Design Patterns - Sets
- Lists Data Structure
- Dictionaries
- Python Design Patterns - Iterator
- Object Oriented Concepts Implementation
- Object Oriented
- Abstract Factory
- Python Design Patterns - Flyweight
- Python Design Patterns - Template
- Python Design Patterns - Strategy
- Python Design Patterns - State
- Python Design Patterns - Observer
- Chain of Responsibility Pattern
- Python Design Patterns - Proxy
- Python Design Patterns - Decorator
- Python Design Patterns - Adapter
- Python Design Patterns - Command
- Python Design Patterns - Facade
- Python Design Patterns - Prototype
- Python Design Patterns - Builder
- Python Design Patterns - Factory
- Python Design Patterns - Singleton
- Model View Controller Pattern
- Python Design Patterns - Gist
- Introduction
- Python Design Patterns - Home
Python Design Patterns Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Strings & Serialization
Strings and Seriapzation
String seriapzation is the process of writing a state of object into a byte stream. In python, the “pickle” pbrary is used for enabpng seriapzation. This module includes a powerful algorithm for seriapzing and de-seriapzing a Python object structure. “Pickpng” is the process of converting Python object hierarchy into byte stream and “unpickpng” is the reverse procedure.
The demonstration of the pickle module is as follows −
import pickle #Here s an example dict grades = { Apce : 89, Bob : 72, Charles : 87 } #Use dumps to convert the object to a seriapzed string serial_grades = pickle.dumps( grades ) print(serial_grades) #Use loads to de-seriapze an object received_grades = pickle.loads( serial_grades ) print(received_grades)
Output
The above program generates the following output −
Advertisements