I'm new to Python and JSON, so I'm sorry if I sound clueless. I'm getting the following result from the Google Translate API and want to parse out the value of "translatedText":
{
"data": {
"translations": [
{
"translatedText": "Toute votre base sont appartiennent à nous"
}
]
}
}
This response is simply stored as a string using this:
response = urllib2.urlopen(translateUrl)
translateResponse = response.read()
So yeah, all I want to do is get the translated text and store it in a variable. I've searched the Python Docs but it seems so confusing and doesn't seem to consider JSON stored as a simple string rather than some super cool JSON object.
jsonmodule in the docs? Did you find the "Basic Usage" section? What was there about the description ofdumpsandloadsthat gave you the impression that the docs didn't "seem to consider JSON stored as a simple string rather than some super cool JSON object"? Would it have been more helpful if the examples were included with each function definition instead of in one big bunch up the front?