forked from HHHHMonkey/-
/
GUI_CeShi.py
58 lines (44 loc) · 1.55 KB
/
GUI_CeShi.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
53
54
55
56
57
58
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 1 15:53:46 2019
@author: 10670
"""
from tkinter import*
import app
def main():
root = Tk()
sort = App(master = root)
sort.master.title("识别")
root.mainloop()
class App(Frame):
def __init__(self, master = None):
Frame.__init__(self, master)
self.grid()
self.PicPath = StringVar()
self.creat_label() #创建标签
self.creat_entry() #创建输入框
self.creat_button() #创建按钮
#self.confirm()
def creat_label(self):
Label(self, text = "请输入要识别的图片链接"). \
grid(row = 0, column = 0, padx = 5, pady = 5, sticky = E)
def creat_entry(self):
Entry(self, width = 20, textvariable = self.PicPath). \
grid(row = 1, column = 0,padx = 5)
def creat_button(self):
Button(self, text = "开始识别", command = self.confirm). \
grid(row = 2, columnspan = 2, padx = 5, pady = 5)
def confirm(self):
# a = self.PicPath.get()
# print(a)
# print(type(a))
#application.pre_pic(a)
# b = 'D:\pic\0.png'
# application.pre_pic(b)
#application.pre_pic(r'D:\pic\0.png')
value = app.application(self.PicPath.get())
Label(self, text = ["识别出的数字是:",value]). \
grid(row = 3, column = 0, padx = 5, pady = 5)
# text = Text(self, )
if __name__ == "__main__":
main()