I want to load a json file. And my code snipped like that:
def getInfoFromJson (dir):
with open(dir, 'r') as f:
data = json.load(f)
objectId = data['id']
Also when I print "f" the output like that:
<_io.TextIOWrapper name='./jsonfiles/2021-04-10_21-05-59_UTC.json' mode='r' encoding='UTF-8'>
But when I try to run I get an error like that:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I tried to several solutions but I cannot solve this. What is the problem? How can I solve this?