Whilst I can use the round() function to return integers once I have the values, how can I avoid the parser throwing an error?ValueError: decimal numbers not supported
Code: Select all
pt1 = "http://api.openweathermap.org/data/2.5/weather?id="
pt2 = "&units=metric&appid="
url = pt1+cfg["Openweathercity"]+pt2+cfg["OpenWeatherAPI"]
req = urlopen(url)
weather = req.read()
weather_json = ujson.loads(weather.decode("utf-8"))
Would that be any better - or should I just manually slice it up and get the integers I need?