根据电话号码获取归属地
程序员文章站
2022-03-03 10:20:23
...
from phone import Phone
def getlocation(num):
if ';' in num:
nums=num.split(';')
for i in nums:
if len(str(i))==11:
try:
info=Phone().find(i)
city = info['city']
return city
except Exception as e:
# print(e)
return ""
else:
if len(str(num))==11:
try:
info=Phone().find(num)
city = info['city']
return city
except Exception as e:
# print(e)
return ""
上一篇: django 序列化
下一篇: Neo图数据库与python交互