1. 程式人生 > >python讀取json文件報 No JSON object could be decoded

python讀取json文件報 No JSON object could be decoded

() col 可用 dep urn geojson log object could

def load():
    with open(D:\\jiance.geojson) as json_file:
        data = json.load(json_file)
        return data

代碼如上,讀取json並load時報錯: No JSON object could be decoded

解決方法:

可用Nodepad++將json文件打開並以UTF8無BOM格式保存,然後再次讀取

python讀取json文件報 No JSON object could be decoded