简略版gui界面调用翻译模块featuretest

import wx
import time
import datetime
import featuretest
def now_time():
    return time.asctime(time.localtime(time.time()))
now = datetime.datetime.now()
class MainWindow(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title, size=(400, 200))
        self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
        self.CreateStatusBar()  # A Statusbar in the bottom of the window
        # Setting up the menu.
        filemenu = wx.Menu()
        optmenu = wx.Menu()
        # wx.ID_about and wx.ID_EXIT are standard IDs provided by wxWidgets.
        menuabout = filemenu.Append(wx.ID_ABOUT, "&about", " Information about this program")
        filemenu.AppendSeparator()
        menuExit = filemenu.Append(wx.ID_EXIT, "&Exit", " Terminate the program")
        meunopen = optmenu.Append(wx.ID_OPEN, "&open", "open a new app")
        meunopt = optmenu.Append(wx.ID_CLOSE,"&close","close the app-file")
        # Creating the menubar.
        menuBar = wx.MenuBar()
        menuBar.Append(filemenu, "&File")  # Adding the "filemenu" to the MenuBar
        menuBar.Append(optmenu, "&option")
        self.Bind(wx.EVT_MENU, self.Onabout, menuabout)
        self.Bind(wx.EVT_MENU, self.OnExit, menuExit)
        self.Bind(wx.EVT_MENU,self.openfile,meunopen)
        self.Bind(wx.EVT_MENU, self.optfile, meunopt)
        self.SetMenuBar(menuBar)  
        self.Show(True)

    def Onabout(self, e):
        dlg = wx.MessageDialog(self, "A small text editor", "about Sample Editor", wx.OK)
        dlg.ShowModal()  # Show it
        dlg.Destroy()  # finally destroy it when finished.

    def OnExit(self, e):
        self.Close(True)  # Close the frame.

    def openfile(self,e):
        app = wx.App(False)
        frame = MainWindow(None, "Sample editor")
        app.MainLoop()

    def optfile(self,e):
        featuretest.digit_blackhole(10000)






app = wx.App(False)
frame = MainWindow(None, "Sample editor")
app.MainLoop()

for x in range(3):
    print("sssss\n",x)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值