import random
import os
import json
class User:
def _init_(self, username, password, balance):
self.username = username
self.password = password
self.balance = balance
def file_read(source):
with open (source) as file:
data = file.read()
dictionary = json.loads(data)
return dictionary
and then the external file is this
{"John":["pass123", 2000], "Jenson": ["pass123", 2000]}
my initial thought was to use a
for items in dict
but i am unsure how to create multiple objects from that preferably being named by username
thank you.