当前位置:网站首页>Serialization oriented - pickle library, JSON Library
Serialization oriented - pickle library, JSON Library
2022-07-04 11:08:00 【It's a cinch!】
Object serialization :
list 、 Dictionaries 、 Sets and tuples are abstract concepts , You need to persist the object , So you need to serialize
Persist the abstract concept of object to disk , Convert objects into bytes and characters
pickle modular —— Convert objects to byte data
dumps—— Convert objects to byte data
loads—— Deserialize byte data into an object
dump—— Convert objects to byte data , And save to file in
load—— take file Deserialize byte data into objects
dumps example :
loads example :
dump example :
load example :
json modular —— General serialization dictionary object , Lists and tuples can also , To a character
dumps—— Convert objects into character data
loads—— Deserialize character data into objects
dump—— Convert objects into character data , And save to file in
load—— take file Character data is deserialized into objects json.load() For from json The data is read from the file
dumps example :
loads example :
dump example :
load example :
边栏推荐
- re. Sub() usage
- [machine] [server] Taishan 200
- Digital simulation beauty match preparation -matlab basic operation No. 6
- Climb Phoenix Mountain on December 19, 2021
- Understanding of object
- Object. Assign () & JS (= >) arrow function & foreach () function
- Is Sanli futures safe? How to open a futures account? How to reduce the handling charge of futures at present?
- Elevator dispatching (pairing project) ①
- QQ group collection
- [Galaxy Kirin V10] [server] soft RAID configuration
猜你喜欢
Discussion | has large AI become autonomous? Lecun, chief scientist of openai
Canoe - the third simulation project - bus simulation - 2 function introduction, network topology
[Galaxy Kirin V10] [desktop] can't be started or the screen is black
Personal thoughts on the development of game automation protocol testing tool
[machine] [server] Taishan 200
Automatic translation between Chinese and English
Ten key performance indicators of software applications
Replace() function
shell awk
Jemeter script recording
随机推荐
First article
Capl: timer event
Solaris 10网络服务
QQ group collection
array_ The contains() function uses
Post man JSON script version conversion
Summary of collection: (to be updated)
Lvs+kept realizes four layers of load and high availability
XMIND installation
Open the neural network "black box"! Unveil the mystery of machine learning system with natural language
Send a request using paste raw text
thread
The most ideal automated testing model, how to achieve layering of automated testing
Introduction to canoe automatic test system
Canoe-the second simulation project-xvehicle-1 bus database design (idea)
MBG combat zero basis
[Galaxy Kirin V10] [server] failed to start the network
QQ get group member operation time
[Galaxy Kirin V10] [server] grub default password
Object. Assign () & JS (= >) arrow function & foreach () function