-
Notifications
You must be signed in to change notification settings - Fork 0
/
M_Capslook.py
50 lines (37 loc) · 874 Bytes
/
M_Capslook.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
##############################
# import
##############################
import wx
import GUI_Capslook
##############################
# GUI的函数桥接
##############################
class CalcFrame(GUI_Capslook.Main):
def __init__(self, parent):
# 定义主函数
GUI_Capslook.Main.__init__(self, parent)
def Run1(self, event):
text = str(self.Text1.Value)
text = text.lower()
self.Text2.SetValue(text)
def Run2(self, event):
text = str(self.Text2.Value)
text = text.upper()
self.Text1.SetValue(text)
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()
if __name__ == "__main__":
main()