wxpython 窗体程序的Hello world

wxpython 窗体程序的Hello world

python实例qingyu2022-02-15 11:30:39645A+A-
import wx


class MainFrame(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)


class App(wx.App):
    def __init__(self):
        super(self.__class__, self).__init__()
        # wx.App.__init__(self)

    def OnInit(self):
        self.version = u"v1.0"
        self.title = "我的第一个窗体程序" + self.version
        frame = MainFrame(None, -1, self.title)
        frame.Show(True)
        return True


if __name__ == "__main__":
    app = App()
    app.MainLoop()

1.png

点击这里复制本文地址 欢迎来到大黄鸡源码分享网
qrcode

大黄鸡源码编程网 © All Rights Reserved.  
网站备案号:闽ICP备18012015号-4
Powered by Z-BlogPHP
联系我们| 关于我们| 广告联系| 网站管理