"/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 5, in <module> File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Код использую не тот, который в пастбине, а укороченный: import json id = 1 with open('bal.json', 'r') as bal: balans = json.load(bal)['bal'+str(id)] json_data = json.load(bal) json_data['bal'+str(id)] = str(balans + 100) with open('bal.json', 'w') as d: d.write(json.dumps(json_data)) with open('bal.json', 'r') as bal: print(bal.read())
А теперь скажите мне, как это связано с кодом который вы скинули выше
.
Обсуждают сегодня