📅  最后修改于: 2022-03-11 14:45:43.217000             🧑  作者: Mango
# install package:
2
pip install phonenumbers
3
4
# code:
5
import phonenumbers
6
from phonenumbers import geocoder
7
from phonenumbers import carrier
8
9
number = '+XXXXXXXXXX'
10
ch_number = phonenumbers.parse(number, "CH")
11
print(geocoder.description_for_number(ch_number, "en"))
12
service_provider = phonenumbers.parse(number, "RO")
13
print(carrier.name_for_number(service_provider, "en"))