Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (10 sloc) 442 Bytes
from urllib.request import urlopen
import xml.etree.ElementTree as etree
def getTemperature(location):
''' Return current temperature in
celsius for given location by
using the google wether service'''
resp = urlopen("" + location)
tree = etree.fromstring(
return tree.find('weather/current_conditions/temp_c').attrib['data']