|
11 | 11 | from Crypto.Cipher import AES |
12 | 12 | from requests import get, post |
13 | 13 | 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 |
15 | 15 |
|
16 | 16 |
|
17 | 17 | class Ydsz: |
@@ -111,13 +111,14 @@ def main_run(): |
111 | 111 | print('错误信息:', e) |
112 | 112 | else: |
113 | 113 | start_time = datetime.now() |
114 | | - end_time = self.day + ' ' + box6.get() + ':' + box7.get() + ':' + '00' |
| 114 | + end_time = text4.get() + ' ' + box6.get() + ':' + box7.get() + ':' + '00' |
115 | 115 | end_time = datetime.strptime(end_time, '%Y-%m-%d %H:%M:%S') |
116 | 116 | seconds = (end_time - start_time).total_seconds() |
117 | 117 | win.destroy() |
118 | 118 | 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: |
121 | 122 | print('距离开始运行还有' + str(int(seconds // 3600)) + '小时' + str(int( |
122 | 123 | (seconds - 3600 * (seconds // 3600)) // 60)) + '分钟') |
123 | 124 | sleep(60) |
@@ -193,24 +194,33 @@ def main_run(): |
193 | 194 | box5.set('1') |
194 | 195 | box5.place(x=80, y=160) |
195 | 196 |
|
| 197 | + frame1 = Frame(win, width=130, height=85, highlightbackground="black", highlightthickness=1) |
| 198 | + |
196 | 199 | self.r1_type = StringVar() |
197 | 200 | 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)) |
200 | 208 |
|
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) |
202 | 210 | 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) |
207 | 215 | 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) |
211 | 221 |
|
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) |
214 | 224 |
|
215 | 225 | win.mainloop() |
216 | 226 |
|
|
0 commit comments