I want to create a record, and I partially succeeded. But here's the problem, I can't record 2, I get the following error. What am I doing wrong?
Error :
File "C:\Users\bilgi\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\bilgi\AppData\Local\Programs\Python\Python39\lib\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)
Example Code :
def loadUsers(self):
# Dosya var?
if os.path.exists('AccInformation.json'): # True ise......
with open('AccInformation.json', 'r', encoding='utf-8') as file:
users = json.load(file)
for user in users:
user = json.load(user)
newUser = Account(user_id = user['user_id'], firstName = user['first_name'], lastName = user['last_name'],
email = user['email'], username = user['username'],
password = user['password'], accountKEY = user['AccountKEY'])
self.users.append(newUser)
print(self.users)
else:
print("""'AccInformation' adlı Dosya bulunamadı.""")
AccInformation.json? - Avión