Hemang-dev / Birthday-remainder-and-wisher

Simple project that will compare the current date to date in predefined birthday log and print
MIT License
4 stars 2 forks source link

Read a data from a file #2

Open bpieszko opened 4 years ago

bpieszko commented 4 years ago

Try to load data from a file. It can be just CSV file or better JSON.

birthdays = []
f = open("data.csv", "r")
lines = f.readlines()
for line in lines:
  name, birthday = line.split(',')
  birthdays.append([name, birthday]) 
bpieszko commented 4 years ago

JSON can be overkill now. You should try CSV.

Hemang-dev commented 4 years ago

Yeah I will try it