[Tutor] IndexError: list index out of range

Danny Yoo dyoo at hashcollision.org
Sat Nov 30 04:14:50 CET 2013


>
>
> Here's another reason for avoiding eval(). Presumably a['hypotheses'] is
> set by the code you download and then eval. That makes it completely
> opaque -- you can't easily see what it is doing, and if it plays up, you
> can't do anything about it. It's a complete black box that either works
> or doesn't work.
>
>

The API is undocumented, as far as I can tell.  That being said, it appears
to be JSON-oriented.

    http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/

So the original questioner should use a JSON parser, rather than eval().
 For example:


http://www.athoughtabroad.com/2013/05/22/using-google-s-speech-recognition-web-service-with-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131129/b62bb2c7/attachment.html>


More information about the Tutor mailing list