-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.py
More file actions
104 lines (84 loc) · 2.82 KB
/
test.py
File metadata and controls
104 lines (84 loc) · 2.82 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
''' else:
give_output("dont know this one should i search on internet?")
ans = take_input()
if "yes" in ans:
answer = check_on_wikipedia(quest)
if answer!="":
return answer
elif "no" == ans:
answer='okay'
return answer
else:
give_output('i dont know this one, can you tell me what it mean')
ans = take_input()
if "it means" in ans:
ans = ans.replace("it means","")
ans.strip()
value = database.get_answers_from_memory(ans)
if value=="":
return("can't help with this one")
else:
database.insert_question_and_answer(quest,value)
return "thanks i will remember it for the next time"
else:
return ("can't help with this")
return('nothing to return')
said = 'my name is kumar'.replace('name',"")
site = said[0:said.index(" ")].strip()
query = said[said.index(" ")+1:].strip()
print(site)
print(query)'''
# importing the module
import pywhatkit
import wikipedia
import os
from datetime import datetime,date
os.system('cls')
'''
now = datetime.now()
hour = int(now.strftime("%H"))
minute = int(now.strftime("%M"))
print (hour)
print (minute+1)
rec = '6268 811 789'
cont="automatically generated msg h bro chill kr"
# using Exception Handling to avoid
# unprecedented errors
try:
# sending message to reciever
# using pywhatkit
pywhatkit.sendwhatmsg(f"+91{rec}", f"{cont}", hour, minute+1)
print("Successfully Sent!")
except:
# handling exception
# and printing error message
print("An Unexpected Error!")'''
'''
# Python code to illustrate Sending mail from
# your Gmail account
import smtplib
# creates SMTP session
s = smtplib.SMTP('smtp.gmail.com', 587)
# start TLS for security
s.starttls()
# Authentication
s.login("friday959822@gmail.com", "9598221049")
# message to be sent
message = "automatically generated msg from F.R.I.D.A.Y"
# sending the mail
s.sendmail("friday959822@gmail.com", "kp959822@gmail.com", message)
# terminating the session
s.quit()
'''
import smtplib
def sendEmail(to, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login('friday959822@gmail.com', '9598221049')
server.sendmail('friday959822@gmail.com', to, content)
server.close()
content = "automatic mail generated by F.R.D.A.Y"
to = "kp959822@gmail.com"
sendEmail(to, content)
print("Email has been sent!")