Answer the question
In order to leave comments, you need to log in
I am writing a database in json, but an error occurs?
Hi everyone, I've come across this problem:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "bot.py", line 179, in ls_chat
data = json.load(file)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 293, in load
return loads(fp.read(),
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 9 column 2 (char 229)
with open('bd_zakaz.txt','r') as file:
data = json.load(file)
{
"2205953": {
"id": 463379321,
"nick": "Igor_Pavlov",
"mesto": "\u0422\u0422\u0423-\u041d",
"kuda": "\u0410\u0432\u0442\u043e\u0441\u0430\u043b\u043e\u043d-\u041d",
"nomer_zakaza": 2205953
}
}{
"2205953": {
"id": 463379321,
"nick": "Igor_Pavlov",
"mesto": "\u0422\u0422\u0423-\u041d",
"kuda": "\u0410\u0432\u0442\u043e\u0441\u0430\u043b\u043e\u043d-\u041d",
"nomer_zakaza": 2205953
},
"4545777": {
"id": 463379321,
"nick": "Igor_Pavlov",
"mesto": "1",
"kuda": "1",
"nomer_zakaza": 4545777
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question