【问题标题】:Strange behavior of wxPython control in Pycharm IDEPycharm IDE中wxPython控件的奇怪行为
【发布时间】:2011-08-04 09:53:53
【问题描述】:

我正在学习 wxPython 2.8 和 Pycharm 1.2.1。 (Python 版本 - 2.6.6,Windows XP)。 我的第一个程序(来自http://wiki.wxpython.org/Getting%20Started#A_First_Application:_.22Hello.2C_World.22):

# hi.py
import wx
class MyFrame(wx.Frame):
    """ We simply derive a new class of Frame. """
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title, size=(200,100))
        self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
        self.Show(True)
app = wx.App(False)
frame = MyFrame(None, 'Small editor')
app.MainLoop()

启动时运行正常: python hi.py 。 但是当它从 PyCharm 开始时 Frame 上没有控件 TextCtrl。 为什么这样?

【问题讨论】:

    标签: wxpython pycharm


    【解决方案1】:

    许多 IDE 在从内部运行 GUI 应用程序时存在问题。我记得 PyScripter 中的类似问题,但不太确定,Wing IDE?据我所知,唯一似乎没有任何此类问题的 IDE 是 Eclipse + PyDev。

    【讨论】:

    • Wingware IDE 可以很好地与 wxPython 配合使用。我已经用 wx 使用它几年了。
    • @Mike Driscoll - 很高兴知道。我确信每次我关闭直接从 IDE 运行的 wxPython 应用程序时,其他一些 IDE 都会崩溃。
    • 我知道 IDLE 和 wx 相处不来。当 Wing 运行代码时,它会在某种单独的进程中执行此操作,因此不会发生冲突。
    • @Mike Driscoll - 对!那就是那个。所以 IDLE 和 PyScripter。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-19
    相关资源
    最近更新 更多