Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The weather appIntroduction | ||||||||
Line: 30 to 33 | ||||||||
This shows that the nearest city for which I can get a woeid is Zürich with the id:784794 Sending the request,using the method reponse = urequests.get(url) with the url below | ||||||||
Added: | ||||||||
> > | ||||||||
https://www.metaweather.com/api/location/784794/returns a json string of this type, from which you can pick the information of interest to you: ![]() | ||||||||
Changed: | ||||||||
< < | response.status_code gives you the http return code (should be 200 if successful). data = response.json() gets the json data for you and converts it into a Python dictionary from which you must extract the information relevant to you. I pick up this information and put it into a friendly GUI: | |||||||
> > | response.status_code gives you the http return code (should be 200 if successful). data = response.json() gets the json data for you and converts it into a Python dictionary from which you must extract the information relevant to you. I pick up this information and put it into a friendly GUI: | |||||||
![]() |