How to convert country names to ISO 3166-1 alpha-2 values, using python

There is a module called pycountry. Here’s an example code: import pycountry input_countries = [‘American Samoa’, ‘Canada’, ‘France’] countries = {} for country in pycountry.countries: countries[country.name] = country.alpha_2 codes = [countries.get(country, ‘Unknown code’) for country in input_countries] print(codes) # prints [‘AS’, ‘CA’, ‘FR’]

Is there a good flag icon pack that corresponds to ISO-3166 Country Codes? [closed]

Is this what you are looking for http://www.famfamfam.com/lab/icons/flags/ Also have a look at: http://icondrawer.com/free.php https://www.gosquared.com/resources/flag-icons http://www.content-pack.com/free-flags-icons/ https://github.com/stevenrskelton/flag-icon http://mdb-blog.blogspot.com/2016/10/list-of-country-flags-png-by-iso3.html https://dribbble.com/shots/1089488-Stripe-Flag-Set

Is there an open source java enum of ISO 3166-1 country codes

Now an implementation of country code (ISO 3166-1 alpha-2/alpha-3/numeric) list as Java enum is available at GitHub under Apache License version 2.0. Example: CountryCode cc = CountryCode.getByCode(“JP”); System.out.println(“Country name = ” + cc.getName()); // “Japan” System.out.println(“ISO 3166-1 alpha-2 code = ” + cc.getAlpha2()); // “JP” System.out.println(“ISO 3166-1 alpha-3 code = ” + cc.getAlpha3()); // “JPN” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)