json.decoder.JSONDecodeError:期望值:第2行第1列(字符1)

时间:2018-08-08 08:52:17

标签: python json python-3.x

我收到此错误。我正在使用Python 3.6.5。

  

json.decoder.JSONDecodeError:预期值:第2行第1列(字符   1)

mycode在这里:

import json 

filename = 'btc_close_2017.json'
with open(filename) as f:
    btc_data = json.load(f)


for btc_dict in btc_data:
    date = btc_dict['date']
    month = int(btc_dict['month'])
    week = int(btc_dict['week'])
    weekday = btc_dict['weekday']
    close = int(float(btc_dict['close'])) 
    print("{} is month {} week {}, {}, the close price is {} RMB".format(
        date, month, week, weekday, close))

0 个答案:

没有答案