今天遇到的问题是
AttributeError: ‘str’ object has no attribute 'write’
原因是在将信息保存到json文件中时需要先open
with open(image_dir, ‘w’) as f:
json.dump(file,f)
这样问题就解决了~
AttributeError: 'str' object has no attribute 'write'
最新推荐文章于 2025-04-14 17:32:17 发布
今天遇到的问题是
AttributeError: ‘str’ object has no attribute 'write’
原因是在将信息保存到json文件中时需要先open
with open(image_dir, ‘w’) as f:
json.dump(file,f)
这样问题就解决了~