1
|
|
|
from tkinter import * |
2
|
|
|
import tkinter |
3
|
|
|
import tkinter |
4
|
|
|
from tkinter import messagebox,StringVar,IntVar,Tk,Button,Entry |
5
|
|
|
from tkinter import ttk |
6
|
|
|
import pywhatkit |
7
|
|
|
import time |
8
|
|
|
|
9
|
|
|
win = Tk() |
10
|
|
|
win.geometry("500x400") |
11
|
|
|
win.title("AutoWhatsapp Message") |
12
|
|
|
#messagebox.showinfo("AutoWhatsappMessage","ENTER THE TIME IN (24 Hours) FORMAT") |
13
|
|
|
|
14
|
|
|
MobNum = StringVar() |
15
|
|
|
Mob2msg=StringVar() |
16
|
|
|
hour = IntVar() |
17
|
|
|
minutes=IntVar() |
18
|
|
|
|
19
|
|
|
Number =ttk.Label(win,text="Enter the Mobile with CountryCode") |
20
|
|
|
Number.place(x=50,y=25) |
21
|
|
|
Message = ttk.Label(win,text = "Enter the Message") |
22
|
|
|
Message.place(x=50,y =100) |
23
|
|
|
hourlabel = ttk.Label(win,text = "Enter the Hours") |
24
|
|
|
hourlabel.place(x=50, y=200) |
25
|
|
|
minuteslabel =ttk.Label(win,text = "Enter the minutes") |
26
|
|
|
minuteslabel.place(x=50, y=250) |
27
|
|
|
Entrynum = Entry(win,textvariable=MobNum) |
28
|
|
|
Entrynum.place(x =250,y=25) |
29
|
|
|
Entrymsg= Entry(win,textvariable=Mob2msg) |
30
|
|
|
Entrymsg.place(x=250, y=100) |
31
|
|
|
timehour= Entry(win,textvariable=hour) |
32
|
|
|
timehour.place(x=250, y=200) |
33
|
|
|
timeminutes = Entry(win, textvariable=minutes) |
34
|
|
|
timeminutes.place(x=250, y=250) |
35
|
|
|
|
36
|
|
|
|
37
|
|
|
ypos = 100 |
38
|
|
|
label = Label(win, text="Schedule Time must be in 24 hours Format.") |
39
|
|
|
|
40
|
|
|
xpos = 0 |
41
|
|
|
|
42
|
|
|
def go(): |
43
|
|
|
messagebox.showinfo("AutoWhatsappMessage","Will open web.whatsapp.com at before 1 minute of Scheduled time and message will be sent Automatically at Scheduled time exactly Given") |
44
|
|
|
try: |
45
|
|
|
num = MobNum.get() |
46
|
|
|
msg = Mob2msg.get() |
47
|
|
|
hr = hour.get() |
48
|
|
|
mini = minutes.get() |
49
|
|
|
pywhatkit.sendwhatmsg(num,msg,hr,mini) |
50
|
|
|
except pywhatkit.CallTimeException: |
51
|
|
|
messagebox.showalert("AutoWhatsAppMessage", "Set Schedule time More than 1 minute from Current Time") |
52
|
|
|
except pywhatkit.CountryCodeException: |
53
|
|
|
messagebox.showalert("AutoWhatsAppMessage", "Please Ensure the mobile number & Coutry code.") |
54
|
|
|
|
55
|
|
|
|
56
|
|
|
GoCheck =ttk.Button(win,text="Start",command=go) |
57
|
|
|
GoCheck.place(x=200, y=350) |
58
|
|
|
infinity= 1 |
59
|
|
|
while infinity==1: |
60
|
|
|
for i in range(260): |
61
|
|
|
xpos = i |
62
|
|
|
label.place(x=xpos,y=0) |
63
|
|
|
time.sleep(0.01) |
64
|
|
|
if (xpos==260): |
65
|
|
|
xpos = 0 |
66
|
|
|
win.update() |
67
|
|
|
# Will open web.whatsapp.com at before 1 minute of Scheduled time and message will be sent at exactly Scheduled time. |
68
|
|
|
|
69
|
|
|
win.mainloop() |
70
|
|
|
|