Skip to content

Commit 936a9be

Browse files
Added Auto B'day Wisher - gssoc'21 avinashkranjan#623
Made the changes suggested by the Moderator.
1 parent 8d2c12e commit 936a9be

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Auto Birthday Wisher/Auto B'Day Wisher.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
print(current_path)
88
os.chdir(current_path) # Changing the Path of the directory in which you are currently working
99

10-
GMAIL_ID = '</ Enter your email here />' # Give your mail here from which you want to send the wishes
11-
GMAIL_PSWD = '</ Enter password for your email here />' # Give your mail password
10+
GMAIL_ID = input("Enter your email: ") # Give your mail here from which you want to send the wishes
11+
GMAIL_PSWD = input("Enter password for your email mentioned above: ") # Give your mail password
1212

1313

1414
def sendEmail(to, sub, msg):
@@ -22,7 +22,6 @@ def sendEmail(to, sub, msg):
2222

2323
if __name__ == "__main__":
2424
df = pd.read_excel("data.xlsx") # the datasheet where the data of the friends is stored
25-
print(df)
2625
today = datetime.datetime.now().strftime("%d-%m")
2726
yearNow = datetime.datetime.now().strftime("%Y")
2827

@@ -31,7 +30,6 @@ def sendEmail(to, sub, msg):
3130
bday = item['Birthday']
3231
bday = datetime.datetime.strptime(bday, "%d-%m-%Y")
3332
bday = bday.strftime("%d-%m")
34-
print(bday)
3533
if(today == bday) and yearNow not in str(item['LastWishedYear']):
3634
sendEmail(item['Email'], "Happy Birthday", item['Dialogue']) # calling the sendmail function
3735
writeInd.append(index)
@@ -41,4 +39,4 @@ def sendEmail(to, sub, msg):
4139
oldYear = df.loc[i, 'LastWishedYear']
4240
df.loc[i, 'LastWishedYear'] = str(oldYear) + ", " + str(yearNow)
4341

44-
df.to_excel('data.xlsx', index=False)
42+
df.to_excel('data.xlsx', index=False)

0 commit comments

Comments
 (0)