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
原文地址:https://www.cnblogs.com/zhulimin/p/15369443.html