citySearcher.py

import logging

# returns corresponding tempAbbr, tempStdCountryName, tempGEO for given countryName
def citySearcher(cityName, citySearcherDic):
cityName = cityName.upper()
if cityName in citySearcherDic.keys():
tempAbbr, tempStdCountryName, tempGEO = citySearcherDic[cityName]

else:
tempAbbr = ""
tempStdCountryName = ""
tempGEO = ""
logging.info("No corresponding info (Abbr, stdCntryName, GEO) was found for city: " + cityName)
return tempAbbr, tempStdCountryName, tempGEO
posted @ 2021-10-05 20:21  石棠  阅读(20)  评论(0编辑  收藏  举报