Get country name from Country code in python?

后端 未结 2 1689
一生所求
一生所求 2021-01-01 22:06

I have worked with 2 python libraries: phonenumbers, pycountry. I actually could not find a way to give just country code and get its corresponding country name.

In

2条回答
  •  攒了一身酷
    2021-01-01 22:54

    Small addition - you also can get country prefix by string code. E.g.:

    from phonenumbers.phonenumberutil import country_code_for_region
    
    print(country_code_for_region('RU'))
    print(country_code_for_region('DE'))
    

提交回复
热议问题