报错 dictionary update sequence element #0 has length 1; 2 is required

报错 dictionary update sequence element #0 has length 1; 2 is required_第1张图片

res.text类型为string, 值为{"usertable":{"UserName":"admin","PassWd":"123456","Role":"1","Author":"NULL"}},

直接使用dict(res.text)会报错,改用json.loads(res.text)可转换为dict:

报错 dictionary update sequence element #0 has length 1; 2 is required_第2张图片

 

你可能感兴趣的:(报错解决,python)