PyNoAppError:必须首先创建wx.App对象! [Python 3.7]

问题描述 投票:0回答:1

我花了一些时间来解决这个问题。我正在测试从https://github.com/wxWidgets/Phoenix/blob/master/samples/ribbon/ribbonbar_demo.py中获取的示例。运行此代码时,出现以下错误消息:


  File "C:/Workspace/gui/RibbonDemo.py", line 86, in __init__
    wx.Frame.__init__(self, parent, id, title, pos, size, style)

PyNoAppError: The wx.App object must be created first!

我该如何解决这个问题。我在Windows 10上使用Spider et Python 3.7

wxpython
1个回答
0
投票

在此链接上查看示例:

https://wxpython.org/Phoenix/docs/html/wx.lib.agw.ribbon.html

对于任何wxPython应用程序,您需要先创建一个wx.App对象。 wxPython演示有点特殊,因为它确实在后台为您创建了它。

© www.soinside.com 2019 - 2024. All rights reserved.