且构网

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

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

更新时间:2023-12-02 23:13:40

问题是对于 json.load 你应该通过一个 read 函数传递一个类似对象的文件定义.所以要么你使用 json.load(response)json.loads(response.read()).

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()).