I have a json string and I am trying to print each section (id, name, link, etc) by using labels on tkinter GUI window.
Data:
{"id":"123456789","name":"John Smith","first_name":"John","last_name":"Smith","link":"http:\/\/www.facebook.com\/john.smith","username":"john.smith","gender":"male","locale":"en_GB"}
Code:
URL = https://graph.facebook.com/ + user
info = urlopen(info).read()
json_format = infor.decode("utf-8")
My problem is how do I assign each section of the json data to a variable do it can be printed out on a tkinter label?
thanks in advance
EDIT
Tried this code:
jsonData = json.loads(json_format)
u_name = jsoninfo['username']
and got the following error message
TypeError: string indices must be integers