Country Module
Python module for country codes with ISO codes.
How to use?
- Download
country.py. - Place
country.pyinto your project folder. - Import it in your program file as:
import country- Now, to get country code:
country.see[country_name][0] # pass '0' to get country code- To get country ISO code:
country.see[country_name][1] # pass '1' to get ISO codeExample:
import country
while True:
cName = input('Country: ').title()
print('Country code of %s: %s' % (cName, country.see[cName][0]))
print('ISO code of %s: %s\n' % (cName, country.see[cName][1]))