本文整理汇总了Python中constants.Constants.load_constants方法的典型用法代码示例。如果您正苦于以下问题:Python Constants.load_constants方法的具体用法?Python Constants.load_constants怎么用?Python Constants.load_constants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类constants.Constants
的用法示例。
在下文中一共展示了Constants.load_constants方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_all_buses
# 需要导入模块: from constants import Constants [as 别名]
# 或者: from constants.Constants import load_constants [as 别名]
logging.info("\nIn find_routes_for_colloquial_bus_numbers: dict_colloquial_bus_numbers :"+str(dict_colloquial_bus_numbers))
return dict_colloquial_bus_numbers
def get_all_buses(self):
"""
Returns the list of colloquial_bus_numbers for the specified city/university.
"""
doublemap_routes_url = self.DOUBLEMAP_ROUTES_API_URL
response = json.loads(urllib.urlopen(doublemap_routes_url).read())
busList = []
for route in response:
busList.append(route['name'])
return busList
if __name__ == "__main__":
#Input
city = "IUB"
#target location coordinates
targetCoordinates = (39.17155659473131, -86.50890111923218)
#Create constans object to fetch all constant values
constantsObject = Constants()
constantsObject.load_constants("constants.json")
#Create route object
routeObject = Route(constantsObject, city)
listColloquialBusNumbers = ['3 College Mall / Bradford Place','6 Campus Shuttle - Sat']
listOfActualBusNumbers = routeObject.get_actual_bus_numbers(listColloquialBusNumbers)
print listOfActualBusNumbers