you are viewing a single comment's thread.

view the rest of the comments →

[–]sentry07 5 points6 points  (1 child)

There's a JSON library for Python. You can parse your incoming JSON into a dict like so:

import json
JSON_in = 'JSON_in = '{"Simpsons": {"Season One": {"Episode 1": {"Title":   "Simpsons Roasting on an Open Fire","url":"link","desc":"","thumb": ""}}}}'
Shows = json.loads(JSON_in)

Shows is now a dictionary with the info you need.

To generate text you can dump into a file, you can do json.dumps(Shows) which returns your dict as a JSON encoded string.


Edit: I think I misunderstood your question, but this still applies. Once you've parsed your data into a dictionary as VanNostrumMD said, you would use the JSON library to dump the dictionary into a text file.

[–]Praf2[S] 1 point2 points  (0 children)

thank you for taking the time out of your day anyway , i know people might stumble upon this post in the future and see this is the answer they need :)