Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # find_north.py
- # find all the busses traveling north
- daves_latitude = 41.98062
- daves_longitude = -87.668452
- from xml.etree.ElementTree import parse
- doc = parse('rt22.xml')
- for bus in doc.findall('bus'):
- lat = float(bus.findtext('lat'))
- if lat > daves_latitude:
- direction = bus.findtext('d')
- if direction.startswith('North'):
- busid = bus.findtext('id')
- print busid, lat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement