Files
lm_code/test.py

9 lines
261 B
Python
Raw Normal View History

2025-10-21 20:27:17 +08:00
import json
2025-10-11 14:39:33 +08:00
2025-10-21 20:27:17 +08:00
# 定义一个 Python 字典
data = {"relationship":"111","name":"1111","phone":"11111111111","workPlace":"11111111","address":"1111"}
2025-10-11 14:39:33 +08:00
2025-10-21 20:27:17 +08:00
# 使用 json.dumps() 方法将字典转换为 JSON 字符串
json_string = json.dumps(data)
2025-10-13 10:20:23 +08:00
2025-10-21 20:27:17 +08:00
print(json_string)