-
Notifications
You must be signed in to change notification settings - Fork 0
/
M_Idion.py
61 lines (47 loc) · 1.07 KB
/
M_Idion.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
59
60
61
##############################
# import
##############################
import wx
import GUI_Idion
##############################
# GUI的函数桥接
##############################
class CalcFrame(GUI_Idion.Main):
def __init__(self, parent):
# 定义主函数
GUI_Idion.Main.__init__(self, parent)
def RUN(self, event):
word = self.input.GetValue()
read(self, word)
def Close(self, event):
try:
if app.GetAppName() != '_core.cp38-win_amd64':
self.Destroy()
except:
self.Hide()
##############################
# 主函数
##############################
def main():
global app
app = wx.App(False)
frame = CalcFrame(None)
frame.Show(True)
app.MainLoop()
def read(self, word):
all = ''
Book = open('./DATA/Idion/idiom.txt')
print(word)
for i in range(1, 11174):
check = Book.readline(i)
##print(len(check))
if word[3] == check[0] and len(check) == 5:
print(check)
all = str(all + check)
self.output.SetValue(all)
if all == '':
self.output.SetValue('NONE')
##Book = Book.readline()
##print(Book)
if __name__ == "__main__":
main()