开发者

wxPython.wx.AboutDialogInfo() has no attribute AboutDialogInfo()

开发者 https://www.devze.com 2023-03-22 08:15 出处:网络
So, I had a problem with wxPython, which I managed to track down to the importing of wx like shown here:

So, I had a problem with wxPython, which I managed to track down to the importing of wx like shown here:

Pyinstaller Activex Attribute Error with wxPython

Thanks to @mike-driscoll's answer开发者_高级运维, I removed all that horrid stuff, and replaced it with

import wxPython

(import wx didn't work...) Now, Whenever I call a class or method from wxPython, I append this at the start of it:

wxPython.wx.

This worked fine with the wxFrame, wxApp, wxSize, wxMenuBar, etc. BUT. When I try to do it with AboutDialogInfo;

Traceback (most recent call last):
  File "C:\Users\Judge\Desktop\LulzApp\Lulz.py", line 101, in aboutApp
    info = wxPython.AboutDialogInfo()
AttributeError: 'module' object has no attribute 'AboutDialogInfo'

What can be done to solve this?


What version of wxPython are you using? The syntax "import wxPython" was deprecated years ago. If "import wx" isn't working, then there's something wrong with your wxPython installation and you should reinstall it. My guess is you have multiple wx installs and maybe that's confusing Python. Once you can do "import wx", use "wx.AboutDialogInfo" and it should work. See the wxPython demo for lots of cool examples of almost every widget in wx.

0

精彩评论

暂无评论...
验证码 换一张
取 消