Python wxpython求助

[复制链接]
查看11 | 回复4 | 2021-1-27 05:17:20 | 显示全部楼层 |阅读模式
大神们,这个程序执行在Pythonidle写完之后,为什么Python不显示呢?还是我的启动方法不对。


分 -->
回复

使用道具 举报

千问 | 2021-1-27 05:17:20 | 显示全部楼层
importwx
classMyFrame(wx.Frame):
def__init__(self):
super().__init__(parent=None,title="窗口标题",size=(400,300),pos=(100,100))
#TODO

classApp(wx.App):
defOnInit(self):
frame=MyFrame()
frame.Show()
returnTrue
defOnExit(self):
print("程序结束")
return0
if__name__=='__main__':
app=App()
app.MainLoop()
试试这个
回复

使用道具 举报

千问 | 2021-1-27 05:17:20 | 显示全部楼层
importwx
classApp(wx.App):
defOnInit(self):
frame=wx.Frame(parent=None,title='abc')
frame.Show()
returnTrue
if__name__=='__main__':
app=App()
app.MainLoop()
你的程序我跑了一遍,能显示啊!
回复

使用道具 举报

千问 | 2021-1-27 05:17:20 | 显示全部楼层
引用1楼python自学者的回复:importwx
classMyFrame(wx.Frame):
def__init__(self):
super().__init__(parent=None,title="窗口标题",size=(400,300),pos=(100,100))
#TODO

classApp(wx.App):
defOnInit(self):
frame=MyFrame()
frame.Show()
returnTrue
defOnExit(self):
print("程序结束")
return0
if__name__=='__main__':
app=App()
app.MainLoop()
试试这个

问题解决了,多谢。一个字母打错了~
回复

使用道具 举报

千问 | 2021-1-27 05:17:20 | 显示全部楼层
引用2楼python自学者的回复:importwx
classApp(wx.App):
defOnInit(self):
frame=wx.Frame(parent=None,title='abc')
frame.Show()
returnTrue
if__name__=='__main__':
app=App()
app.MainLoop()
你的程序我跑了一遍,能显示啊!

多谢,问题解决了。一个字母打错了,,
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行