网站首页
编程语言
数据库
系统相关
其他分享
编程问答
textJson
2024-10-18
解决TypeError: 'NoneType' object is not subscriptable
1.捕获异常的方式try:img_list=img_list["name"]except:img_list=""2.对象进行判断ifimg_list:img_list=img_list["name"]else:img_list=""demotextJson=json.loads(res.text)#转json对象iftextJson:##整个对象都