Last active
August 29, 2015 14:24
-
-
Save johncant/5d821e09ca21564f6245 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##!/usr/bin/env python3 | |
# | |
#import urllib.request | |
# | |
## Read XML from TFL website | |
# | |
#url = 'http://cloud.tfl.gov.uk/TrackerNet/LineStatus' | |
#response = urllib.request.urlopen(url) | |
#xml = response.read().decode('utf-8') | |
# | |
## Parse XML into a dict | |
# | |
#import xmltodict | |
# | |
#xmldict = xmltodict.parse(xml) | |
# | |
## Do the magic | |
# | |
#statuses = xmldict['ArrayOfLineStatus']['LineStatus'] | |
# | |
#for status in statuses: | |
# print(status['Line']['@Name'] + '|' + status['Status']['@Description']) | |
# | |
# Refactored: | |
print("On strike") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment