-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
52 lines (35 loc) · 966 Bytes
/
gui.py
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
import tkinter as tk
import os
import glob
def save(event):
global name
file_name = name.get()
name.delete(0, "end")
global img_label
img_label.destroy()
global file_list
global i
os.rename(file_list[i], file_name + ".png")
i += 1
global image
image = tk.PhotoImage(file=file_list[i])
img_label = tk.Label(window, image=image)
img_label.pack()
label["text"] = i
file_list = glob.glob(r"D:\Github\captcha_recognition\captcha\unlabled\chapcah*.png")
print(file_list)
window = tk.Tk()
window.title("Hi")
window.geometry("200x150")
window.resizable(False, False)
i=0
label=tk.Label(window, text=str(i))
label.pack()
image = tk.PhotoImage(file=file_list[i])
img_label = tk.Label(window, image=image)
img_label.pack()
name = tk.Entry(window)
name.place(x=30, y=80, width=150, height=25)
name.focus()
window.bind('<Return>', save)
window.mainloop()