【问题标题】:How can I fix the Scyther wx.splashscreen error?如何修复 Scyther wx.splashscreen 错误?
【发布时间】:2020-04-01 04:50:25
【问题描述】:

安装 Scyther 以及 Graphwiz 和 wxPython 后,我收到错误:

File "scyther-gui.py", line 141, in <module>
class MySplashScreen(wx.SplashScreen):

AttributeError: 'module' 对象没有属性 'SplashScreen'

【问题讨论】:

    标签: python wxpython splash-screen


    【解决方案1】:

    这显然是因为 Scyther 是用旧版本的 wxPython 编写的。

    我发现 Thomas Fleming 已经更新了 wxPython 的更新版本(我有 4.0.7.post2),你可以找到他的 GitHub 存储库here。看起来它会在某个时候被拉入主分支,但此刻我使用了他的叉子。 自述文件中的说明非常清楚,我按照它们没有问题,但对我来说,文件scyther-linux 没有自动从/src 复制到/gui,所以我不得不手动移动它。

    他的修复似乎也适用于 mac 上的人,但是,我使用的是 Ubuntu 18.4,虽然我克服了启动画面错误并加载了 Scyther,但我无法打开文件,得到

    File "/home/weaver/tools/scyther-master/gui/Gui/Mainwindow.py", line 291, in OnOpen
        if self.askUserForFilename(style=wx.OPEN,
    AttributeError: 'module' object has no attribute 'OPEN'
    

    等价于保存。

    为了解决这个问题,我打开了/gui/Gui/Mainwindow.py,并将第 291 行从

    if self.askUserForFilename(style=wx.OPEN,
    

    到

    if self.askUserForFilename(style=wx.FD_OPEN,
    

    在第 302 行对 wx.SAVE 做了同样的事情,将其更改为 wx.FD_SAVE。

    到目前为止,一切似乎都运行良好。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-04
      • 2016-11-17
      • 2011-07-24
      • 2021-05-10
      • 2017-07-17
      • 2013-03-05
      • 2016-09-10
      相关资源
      最近更新 更多