Pygtk 和分段错误
为什么我会遇到这个分段错误?:
>>> import gtk
>>> a = gtk.Window()
>>> a.show()
>>> b = gtk.Dialog("hellooo")
>>> b.show() # here the dialog appears
>>> b.show()
Segmentation fault
Why I get this segmentation fault?:
>>> import gtk
>>> a = gtk.Window()
>>> a.show()
>>> b = gtk.Dialog("hellooo")
>>> b.show() # here the dialog appears
>>> b.show()
Segmentation fault
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是从源代码安装还是使用系统的软件包安装?
我建议使用 apt-get、yum 或类似工具重新安装
Did you install from source or using your system's packages?
I would recommend a reinstall, using
apt-get
,yum
or similar我遇到分段错误。因此,在对话框显示一次后不要再 show() 对话框。该对象已被创建和销毁,并且您正在尝试重用它。不要那样做。制作一个新的。或者:“医生,我这样做的时候会很痛……”
I get a segmentation fault. So don't show() a dialog after it has been shown once. The object has been created and destroyed and you are trying to reuse it. Don't do that. Make a new one. Or: "Doctor, it hurts when I do this..."
您可能在“图形”环境之外运行代码。 IE。具有有效的
DISPLAY
环境变量。You are likely running your code outside of a "graphical" environment. ie. one with a valid
DISPLAY
environment variable.