且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AttributeError(“" str"对象没有属性"read"")

更新时间:2023-12-02 23:05:58

问题是,对于json.load,您应该传递定义了read函数的类似对象的文件.因此,您可以使用 json.load(response)

The problem is that for json.load you should pass a file like object with a read function defined. So either you use json.load(response) or json.loads(response.read()).