Skip to content
Python module for country codes with ISO codes.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
country.py

README.md

Country Module

Python module for country codes with ISO codes.

How to use?

  • Download country.py.
  • Place country.py into 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 code

Example:

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]))
You can’t perform that action at this time.