def convert_name_to_number(name): station_dict = get_station_dict() ret = "" try: ret = station_dict.get(name) except: print(name + " is not existed in dict", file=sys.stderr) sys.exit(1) return ret
def main(): option = get_option() if option.list: dct = get_station_dict() for key in dct.keys(): print(key) sys.exit(0) try: src = getsrc(option) except ConnectionError: print("Connection Error!", file=sys.stderr) except Exception as e: print(type(e), " exception had raised.", file=sys.stderr) left_minutes = get_next_bus_time(src) for minute in left_minutes: print(minute)