Possible Duplicate:
Where can I get a list of all countries/cities to populate a listbox?
Working on a system that needs a list of all countries, I've found that the common "trick" (*) of using CultureInfo
and RegionInfo
gives a list that is incomplete (missing Cuba, for example).
(*) See Country List for ComboBox or DropDown from .NET Globalization Namespace for one example.
Given that this approach fails, what's a better way to do this?
I guess we can fall back on adding a database table and manually populating a list of countries, but surely there's a smarter way.
One way to find duplicate records from the table is the GROUP BY statement. The GROUP BY statement in SQL is used to arrange identical data into groups with the help of some functions. i.e if a particular column has the same values in different rows then it will arrange these rows in a group.
Python list can contain duplicate elements.
There are also web services that provide this type of data, so perhaps you could periodically make use of a web service call and store it to local data store (e.g. a database or XML).
Which are the countries you're looking for? An what names do you want?
This is a list of all 193 members of the United Nations with their official designation (preceded by ISO 3166 code)
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG Antigua and Barbuda
AL Albania
AM Armenia
AO Angola
AR Argentina
AT Austria
AU Australia
AZ Azerbaijan
BA Bosnia and Herzegovina
BB Barbados
BD Bangladesh
BE Belgium
BF Burkina Faso
BG Bulgaria
BH Bahrain
BI Burundi
BJ Benin
BN Brunei Darussalam
BO Bolivia (Plurinational State of)
BR Brazil
BS Bahamas
BT Bhutan
BW Botswana
BY Belarus
BZ Belize
CA Canada
CD Democratic Republic of the Congo
CF Central African Republic
CG Congo
CH Switzerland
CI Côte d'Ivoire
CL Chile
CM Cameroon
CN China
CO Colombia
CR Costa Rica
CU Cuba
CV Cape Verde
CY Cyprus
CZ Czech Republic
DE Germany
DJ Djibouti
DK Denmark
DM Dominica
DO Dominican Republic
DZ Algeria
EC Ecuador
EE Estonia
EG Egypt
ER Eritrea
ES Spain
ET Ethiopia
FI Finland
FJ Fiji
FM Micronesia (Federated States of)
FR France
GA Gabon
GB United Kingdom of Great Britain and Northern Ireland
GD Grenada
GE Georgia
GH Ghana
GM Gambia
GN Guinea
GQ Equatorial Guinea
GR Greece
GT Guatemala
GW Guinea-Bissau
GY Guyana
HN Honduras
HR Croatia
HT Haiti
HU Hungary
ID Indonesia
IE Ireland
IL Israel
IN India
IQ Iraq
IR Iran (Islamic Republic of)
IS Iceland
IT Italy
JM Jamaica
JO Jordan
JP Japan
KE Kenya
KG Kyrgyzstan
KH Cambodia
KI Kiribati
KM Comoros
KN Saint Kitts and Nevis
KP Democratic People's Republic of Korea
KR Republic of Korea
KW Kuwait
KZ Kazakhstan
LA Lao People's Democratic Republic
LB Lebanon
LC Saint Lucia
LI Liechtenstein
LK Sri Lanka
LR Liberia
LS Lesotho
LT Lithuania
LU Luxembourg
LV Latvia
LY Libyan Arab Jamahiriya
MA Morocco
MC Monaco
MD Republic of Moldova
ME Montenegro
MG Madagascar
MH Marshall Islands
MK The former Yugoslav Republic of Macedonia
ML Mali
MM Myanmar
MN Mongolia
MR Mauritania
MT Malta
MU Mauritius
MV Maldives
MW Malawi
MX Mexico
MY Malaysia
MZ Mozambique
NA Namibia
NE Niger
NG Nigeria
NI Nicaragua
NL Netherlands
NO Norway
NP Nepal
NR Nauru
NZ New Zealand
OM Oman
PA Panama
PE Peru
PG Papua New Guinea
PH Philippines
PK Pakistan
PL Poland
PT Portugal
PW Palau
PY Paraguay
QA Qatar
RO Romania
RS Serbia
RU Russian Federation
RW Rwanda
SA Saudi Arabia
SB Solomon Islands
SC Seychelles
SD Sudan
SE Sweden
SG Singapore
SI Slovenia
SK Slovakia
SL Sierra Leone
SM San Marino
SN Senegal
SO Somalia
SR Suriname
SS South Sudan
ST Sao Tome and Principe
SV El Salvador
SY Syrian Arab Republic
SZ Swaziland
TD Chad
TG Togo
TH Thailand
TJ Tajikistan
TL Timor-Leste
TM Turkmenistan
TN Tunisia
TO Tonga
TR Turkey
TT Trinidad and Tobago
TV Tuvalu
TZ United Republic of Tanzania
UA Ukraine
UG Uganda
US United States of America
UY Uruguay
UZ Uzbekistan
VC Saint Vincent and the Grenadines
VE Venezuela (Bolivarian Republic of)
VN Viet Nam
VU Vanuatu
WS Samoa
YE Yemen
ZA South Africa
ZM Zambia
ZW Zimbabwe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With