当前位置:网站首页>JSON module dictionary and string conversion
JSON module dictionary and string conversion
2022-06-25 15:16:00 【Students' notes of Cai Cai make little progress every day】
"""
-*- coding:utf-8 -*-
@Time :2021/6/19 15:35
@AUTHOR : Vegetable classmate
@SOFTWARE :untitled3
"""
a = '{"mobile_phone":"13800010002","pwd":"12345678","sex":null}' # Define a string type , And print the comparison
print(a)
import json # Import json modular
a_dict = json.loads(a) # use json.load Convert string to dictionary
print(a_dict) # Print out the dictionary type
print("********** Split line ************")
dict_a = {'mobile_phone': '13800010002', 'pwd': '12345678', 'sex': None} # Define a dictionary type , And print out the comparison
print(dict_a)
b = json.dumps(dict_a,ensure_ascii=False) # use json.dumps Convert dictionary to string , Add encoding format
print(b) The output is as follows :

边栏推荐
- 15 -- k points closest to the origin
- Qt: Pro project file
- Data feature analysis skills - correlation test
- Fishing detection software
- 14 -- validate palindrome string II
- 55 specific ways to improve program design (2)
- JS select all exercise
- Semaphore function
- Pytorch distributed test pit summary
- basic_ String mind map
猜你喜欢
![[try to hack] vulhub shooting range construction](/img/fc/6057b6dec9b51894140453e5422176.png)
[try to hack] vulhub shooting range construction

Afterword of Parl intensive learning 7-day punch in camp

QT pattern prompt box implementation
![[paper notes] poly yolo: higher speed, more precise detection and instance segmentation for yolov3](/img/28/6d58759a4a4b18923a5ed5ed573956.jpg)
[paper notes] poly yolo: higher speed, more precise detection and instance segmentation for yolov3

(2) Relational database

Single user mode

Review of arrays and pointers triggered by a topic
![[C language] implementation of magic square array (the most complete)](/img/b2/2595263b77e0abac667972bbfe0c8a.jpg)
[C language] implementation of magic square array (the most complete)

From 408 to independent proposition, 211 to postgraduate entrance examination of Guizhou University

Time stamp calculation and audio-visual synchronization of TS stream combined video by ffmpeg protocol concat
随机推荐
Work of the first week
2. operator and expression multiple choice questions
55 specific ways to improve program design (1)
Advertising effect cluster analysis (kmeans)
Real variable instance
Brain tree (I)
Modal and modeless dialogs for QT
Usage of qlist
[paper notes] poly yolo: higher speed, more precise detection and instance segmentation for yolov3
Customization and encapsulation of go language zap library logger
One question per day, punch in
Boost listening port server
14 -- 验证回文字符串 Ⅱ
Errno perrno and strerrno
SPARQL learning notes of query, an rrdf query language
About%*s and%* s
Dynamic memory allocation
RDB and AOF persistence of redis
HMS core machine learning service realizes simultaneous interpretation, supports Chinese-English translation and multiple voice broadcast
Why should the coroutine be set to non blocking IO