# json字符串处理为字典
json_s = '[{"status":401,"msg":"用户名密码错误","st":true}]'
print(json_s)
# 处理成字典?
import json
json_dict = json.loads(json_s)
print(json_dict)
# 字典转json字符串
json_dict = {'status': 401, 'msg': '用户名密码错误', 'st': True}
json_s = json.dumps(json_dict)
print(json_s)
# 列表和元组可以互转
my_tup = ('name', 'will')
my_tup[0]
使用场景,全局变量
my_list = list(my_tup)
print(my_list)
print(tuple(my_list))