用Py2EXE和IDLE-X编译WxPython

2024-05-19 00:40:27 发布

您现在位置:Python中文网/ 问答频道 /正文

目前,我正在学习python,并在尝试编译python代码。在

我遇到的问题是,一旦脚本被编译,它就没有响应。在

我了解到IDLE-X扩展可以帮助解决这个问题,但是编译之后也会出现同样的错误。我运行的是64位Windows7Ultimate、WXPython2.7、Python2.7和py2exe for 2.7。->

import wx

class aero(wx.Frame):

def __init__(self,parent,id):
    wx.Frame.__init__(self,parent,id,'Aero v1.0b', size=(500,500))
    panel=wx.Panel(self)

    status=self.CreateStatusBar()
    menubar=wx.MenuBar()
    first=wx.Menu()
    second=wx.Menu()
    first.Append(wx.NewId(),"New Window","This is a new window" )
    first.Append(wx.NewId(),"Open...","This will open a new window" )
    menubar.Append(first,"File")
    menubar.Append(second,"Edit")
    self.SetMenuBar(menubar)


if __name__=='__main__':
app=wx.PySimpleApp()
frame=aero(parent=None,id=-1)
frame.Show()
app.MainLoop

我从这个帖子得到了一些帮助:pythonw.exe is not responding

我想知道为什么会这样。在

非常感谢。在


Tags: selfidinitisthisframeparentfirst

热门问题