JSON 文字列があり、tkinter GUI ウィンドウでラベルを使用して各セクション (ID、名前、リンクなど) を印刷しようとしています。
データ:
{"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"}
コード:
URL = https://graph.facebook.com/ + user
info = urlopen(info).read()
json_format = infor.decode("utf-8")
私の問題は、json データの各セクションを変数に割り当てる方法です。tkinter ラベルに出力できますか?
前もって感謝します
編集
このコードを試しました:
jsonData = json.loads(json_format)
u_name = jsoninfo['username']
次のエラーメッセージが表示されました
TypeError: string indices must be integers