with open('twit/example.json', encoding='utf8') as json_data:
for line in json_data:
try:
dataText = json.loads(line)
except ValueError:
continue
for a in dataText:
print(a["user"]["location"])
the result is: string indices must be integers
Update: The below answer is for printing
print(dataText["user"]["location"])
now I want this one:
print(a["user"]["location"])