Skip to content

Commit 63f78a5

Browse files
committed
Update YdszTool.py
1 parent d64a5c6 commit 63f78a5

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

YdszTool.py

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from Crypto.Cipher import AES
1212
from requests import get, post
1313
from urllib3 import disable_warnings
14-
from tkinter import Tk, StringVar, Label, Entry, Button, ttk, END, Checkbutton
14+
from tkinter import Tk, StringVar, Label, Entry, Button, ttk, END, Checkbutton, Frame
1515

1616

1717
class Ydsz:
@@ -111,13 +111,14 @@ def main_run():
111111
print('错误信息:', e)
112112
else:
113113
start_time = datetime.now()
114-
end_time = self.day + ' ' + box6.get() + ':' + box7.get() + ':' + '00'
114+
end_time = text4.get() + ' ' + box6.get() + ':' + box7.get() + ':' + '00'
115115
end_time = datetime.strptime(end_time, '%Y-%m-%d %H:%M:%S')
116116
seconds = (end_time - start_time).total_seconds()
117117
win.destroy()
118118
if seconds > 120:
119-
print('开始倒计时,将在' + str(end_time.strftime('%Y-%m-%d %H:%M:%S')) + '两分钟前开始运行')
120-
while seconds > 120:
119+
print('开始倒计时,将在' + str(end_time.strftime('%Y-%m-%d %H:%M:%S')) + '两分钟前开始预约')
120+
seconds -= 120
121+
while seconds > 0:
121122
print('距离开始运行还有' + str(int(seconds // 3600)) + '小时' + str(int(
122123
(seconds - 3600 * (seconds // 3600)) // 60)) + '分钟')
123124
sleep(60)
@@ -193,24 +194,33 @@ def main_run():
193194
box5.set('1')
194195
box5.place(x=80, y=160)
195196

197+
frame1 = Frame(win, width=130, height=85, highlightbackground="black", highlightthickness=1)
198+
196199
self.r1_type = StringVar()
197200
self.r1_type.set('F')
198-
r1 = Checkbutton(win, text="定时提交预约", variable=self.r1_type, onvalue="T", offvalue="F")
199-
r1.place(x=170, y=67)
201+
r1 = Checkbutton(frame1, text="定时提交预约", variable=self.r1_type, onvalue="T", offvalue="F")
202+
r1.place(x=15, y=0)
203+
204+
text4 = Entry(frame1, width=16)
205+
text4.insert(END, "日期:2021-12-06")
206+
text4.place(x=5, y=28)
207+
text4.bind("<Button-1>", lambda a: text4.delete(0, END))
200208

201-
box6 = ttk.Combobox(master=win, state="readonly", values=[str(i) for i in range(0, 23)], width=2)
209+
box6 = ttk.Combobox(master=frame1, state="readonly", values=[str(i) for i in range(0, 23)], width=2)
202210
box6.set('0')
203-
box6.place(x=170, y=100)
204-
txt8 = Label(win, text="时")
205-
txt8.place(x=210, y=100)
206-
box7 = ttk.Combobox(master=win, state="readonly", values=[str(i) for i in range(0, 60)], width=2)
211+
box6.place(x=5, y=55)
212+
txt8 = Label(frame1, text="时")
213+
txt8.place(x=45, y=55)
214+
box7 = ttk.Combobox(master=frame1, state="readonly", values=[str(i) for i in range(0, 60)], width=2)
207215
box7.set('0')
208-
box7.place(x=230, y=100)
209-
txt9 = Label(win, text="分")
210-
txt9.place(x=270, y=100)
216+
box7.place(x=65, y=55)
217+
txt9 = Label(frame1, text="分")
218+
txt9.place(x=105, y=55)
219+
220+
frame1.place(x=160, y=68)
211221

212-
btn = Button(win, text="预约", command=main_run, width=14, height=2)
213-
btn.place(x=170, y=132)
222+
btn = Button(win, text="预约", command=main_run, width=14)
223+
btn.place(x=170, y=158)
214224

215225
win.mainloop()
216226

0 commit comments

Comments
 (0)