我正在用python读取json文件,其中包含大量导入的商品数据:
import json
with open("data.json") as f:
data = json.load(f)
print(data)
但它显示此错误
File "C:\Users\ALAA\Desktop\hello\dictionary.py", line 4
data = json.load(f)
^
IndentationError: expected an indented block
现在我收到此错误!!!
Traceback (most recent call last):
File "C:\Users\ALAA\Desktop\hello\dictionary.py", line 2, in <module>
with open("data.json") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'data.json'
答案 0 :(得分:2)
您的代码缩进得不好
尝试一下:
java.lang.RuntimeException: json can't serialize type : class org.springframework.data.domain.example