-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (24 loc) · 920 Bytes
/
main.py
File metadata and controls
33 lines (24 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from country import Country
import csv
def main():
with open("countries.csv", 'r', newline='') as file:
reader = csv.DictReader(file)
if not reader.fieldnames:
print("no data")
return
bulk_countries = []
for line in reader:
country = Country(
line['Country Name'],
line['Country Code'],
line['Series Name'],
line['Series Code'],
line['2020 [YR2020]'])
bulk_countries.append(country)
# countries = set(bulk_countries)
for i in range(len(bulk_countries)):
print(bulk_countries[i].get_country_name() + ":", bulk_countries[i].get_series_name() + ":", bulk_countries[i].get_data())
# for country in countries:
# print(country)
if __name__ == "__main__":
main()