Created
October 6, 2020 02:52
-
-
Save Abhayparashar31/614a201347a0ef7cdfde045aad24977a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for index, item in df.iterrows(): | |
#print(index,item['birthday']) | |
bday = item['Birthday'].strftime("%d-%m") ##wishing time from excel file | |
#print(type(bday)) | |
if(bday == today) and yearnow not in str(item["Year"]): ## birthday data == today date and birthday year is not equal to current year | |
sendEmail(item['Email'] ,"Happy BIrthday "+item["Name"], item['message']) ## pass arguments to the send email funciton and call it | |
update.append(index) ## update the index by one ## we need to check the whole records | |
for i in update: | |
yr = df.loc[i, 'Year'] ## update the year by one | |
#print(yr) | |
df.loc[i,'Year'] = f"{yr}, {yearnow}" | |
#print((df.loc[i, 'Year']) | |
#print(df) | |
df.to_excel("data.xlsx", index=False) ## convert the df to excel file and save it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment