9 lines
261 B
Python
9 lines
261 B
Python
import json
|
|
|
|
# 定义一个 Python 字典
|
|
data = {"relationship":"111","name":"1111","phone":"11111111111","workPlace":"11111111","address":"1111"}
|
|
|
|
# 使用 json.dumps() 方法将字典转换为 JSON 字符串
|
|
json_string = json.dumps(data)
|
|
|
|
print(json_string) |