data1 = country.alt_spellings() print(data1) data2 = country.capital() print(data2) data3 = country.currencies() print(data3) data4 = country.languages() print(data4) data5 = country.timezones() print(data5) data6 = country.area() print(data6) data7 = country.borders() print(data7) data8 = country.calling_codes() print(data8) data9 = country.wiki() print(data9) data10 = country.info() for x, y in data10.items(): print(f'{x} --> {y}')
def get_wiki_page_by_country(country): country = CountryInfo(country) return country.wiki()
country_region = country.region() print(f'\nRegion:\n{country_region}') sub_region = country.subregion() print(f'\nSub-Region:\n{sub_region}') country_population = country.population() print(f'\nPopulation:\n{country_population}') country_states = country.provinces() print('\nStates/Provinces:') for states in country_states: print(states, end=', ') about_country = country.wiki() country_map = country.capital_latlng() map = folium.Map(location=(country_map)) print( f'\n\nCheck your directory for the map of {user}, named: (mylocation.html)' ) map.save("mylocation.html") about_country = country.wiki() data = about_country qr = qrcode.QRCode(version=1, box_size=15, border=5) qr.add_data(data) qr.make(fit=True) img = qr.make_image(fill_color='black', back_color='white')