-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMepits_Tutorials
More file actions
40 lines (29 loc) · 904 Bytes
/
Mepits_Tutorials
File metadata and controls
40 lines (29 loc) · 904 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
34
35
36
37
38
39
40
import csv
import pickle
#from pushbullet import Pushbullet
import smtplib
file = 'mepits.csv'
rows =[]
with open(file, 'r') as csv_file:
reader = csv.reader(csv_file)
for row in reader:
rows.append(row[0])
pic = open("counter.pickle","rb")
count = list(pickle.load(pic))
count[0] +=1
print(count)
pic.close()
pickle_out = open("counter.pickle",'wb')
pickle_in = pickle.dump(count,pickle_out)
pickle_out.close()
pic = open("counter.pickle","rb")
link_number = pickle.load(pic)
s = smtplib.SMTP('smtp.gmail.com',587)
s.starttls()
s.login('Your email',"Your Email app password") #get app password and allow less secured app after that confirm your activity.
message = "\nToday's MEPITS Tutorial %s" %(str(rows[link_number[0]]))
#print(message)
s.sendmail('From-email','to-email',message)
s.quit()
#link_number = pickle.load(pic)
#pb.push_note("MEPITS",body=rows[link_number[0]])