How to insert Weather Underground forecast icons

Asked

Viewed 35 times

0

Good afternoon

I’m trying to insert the Weather Underground icons but no Python 3 icons. Below I leave a part of the code.

url = "http://api.wunderground.com/api/api_Key/forecast/lang:PT/q/PT/Lisbon.json"

temp = urllib.request.urlopen(url)

json_string = temp.read()

parsed_json = json.loads(json_string)

ico = parsed_json['forecast']['simpleforecast']['forecastday'][0]['icon']

img = PhotoImage(ico)

label1 = Label(window, image=img)

label1.image = img

label1.pack()

Thanks for the help

  • Is the request being successfully completed? You are correctly setting the KEY API to make it?

  • yes, the key API is correct, I can see the temperatures and the rest, only the icons do not appear

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.