I have gotten the response of google json api and saved the file in a json file which looks like this
JSON file drive.google.com/open?id=1Esuv9KpikqhwccL-dGm-IFfI5S6V7plV
And I want to parse it in python 2. I've tried
for result in response.results:
# The first alternative is the most likely one for this portion.
print('Transcript: {}'.format(result.alternatives[0].transcript))
print('Confidence: {}'.format(result.alternatives[0].confidence))
but it throws the error
'str' object has no attribute 'results'
later I tried
jsondata = json.load(json_file_path)
but it says
'str' object has no attribute 'read'
Any help?
See Question&Answers more detail:os