Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The weather appIntroduction | ||||||||
Line: 38 to 38 | ||||||||
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: | ||||||||
Changed: | ||||||||
< < | ![]() | |||||||
> > | ![]() | |||||||
Changed: | ||||||||
< < | If you compare this with the json string, you should find back the information. Only the wind speed is different because I convert the units from mph to kph. | |||||||
> > | If you compare this with the json string, you should find back the information. Only the wind speed is different because I convert the units from mph to kph. You can also see that it is really cold here in Switzerland in February! | |||||||
openweathermap.orgThe basic way for getting weather data from openweathermap.org is the same as described above. However the url string is different following a different API. On openweathermap.org you don't need the woeid, but you can use a city name or the GPS data directly. On the other hand you need an extra apikey, which you get with your registration. | ||||||||
Line: 52 to 52 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Added: | ||||||||
> > |
|