加载多个json文件-'JSONDecodeError:期望值'

时间:2018-07-05 16:04:13

标签: json python-3.x

我正在加载多个json文件:

path_to_jsonfiles = '/Users/Dataminingnew/jsonfile/'
for file in os.listdir(path_to_jsonfiles):
     json_data = "%s/%s" % (path_to_jsonfiles, file)
      with open(json_data) as fi:
          rawdata = json.loads(json_data)

但是我遇到了这个错误:

raise JSONDecodeError("Expecting value", s, err.value) from None
JSONDecodeError: Expecting value

为什么会这样?

0 个答案:

没有答案