python - wxPython - 带有 Gif 的 AnimationCtrl 导致内核崩溃
问题描述
我使用这段代码试图在我的 GUI 中显示和动画 Gif。但是如果我运行它,我的内核会立即死亡。
我做错了什么?
这是我的代码:
import wx
from wx.adv import Animation, AnimationCtrl
class TestPanel(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1)
sizer = wx.BoxSizer(wx.VERTICAL)
gif_fname = wx.adv.Animation("Test.gif")
gif = wx.adv.AnimationCtrl(parent=self,anim=gif_fname)
gif.GetAnimation()
self.gif = gif
self.gif.Play()
sizer.Add(gif)
self.SetSizerAndFit(sizer)
self.Show()
if __name__ == '__main__':
test=wx.App()
TestPanel(None)
test.MainLoop()
解决方案
推荐阅读
- php - 我想在 php 上包含来自网络的代码。示例:需要“domain.com/folder/file.php”;
- javascript - 您可以使用 Crossfilter 在组内过滤吗
- google-apps-script - Google App Script My Project 中的多个文件
- python - Python温度转换器中请求的错误处理帮助
- python - 从“外部”目录导入模块 [Python]
- python - 来自初学者的简单 DataFrame 问题
- vue.js - Vue:导入 JSON 请求加载器
- python - 使用 Pandas Dataframe 时 casefold() 函数不起作用
- c++ - /bin/sh: cc: 找不到命令
- twig - 无法使用 Composer 安装 Twig