所以我有此功能来读取json文件并返回通过它的文件中数据的字典
def file_read(source):
with open(source) as file:
data = file.read()
dictionary = json.loads(data)
return dictionary
我正在使用的文件名为“ users.json”并已格式化
{"Jim":("password","MMA60V")}
但是,每当我尝试运行代码以读取“ users.json”中的内容时,都会出现此错误
json.decoder.JSONDecodeError: Expecting value: line 1 column 8 (char 7)```
does anyone know why this is happening and a possible solution thank you.