OS: Ubuntu 12.1、python: 2.7.3、wx: 2.8 gtk2
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import wx
import sys
class Frame (wx.Frame):
    def __init__(self, parent, id, title):
        print "Frame Initialised"
        wx.Frame.__init__(self, parent, id, title)
class App (wx.App):
    def __init__ (self, redirect=True, filename=None):
        print "Application Initialised"
        wx.App.__init__(self, redirect, filename)
    def OnInit (self):
        print "This is Application"
        self.frame = Frame (parent=None, id=-1, title="Startup")
        self.frame.show ()
        self.SetTopWindow (self.frame)
        print >> sys.stderr, "A fake error message"
        return True
    def OnExit (self):
        print "Application Exiting"
if __name__ == '__main__':
    app = App (redirect=True)
    print "Things Before"
    app.MainLoop ()
    print "Things After"
エラー:
(python:3805): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap"
このエラーは 3 回繰り返され、出力が得られません。スクリプトに何か問題がありますか?お手伝いありがとう。
pixbuf をインストールして警告を修正しました。
sudo apt-get install gtk2-engines-pixbuf
ここで、新たな問題が発生しました。フレームが点滅し、すぐに消えます。リダイレクトされたメッセージが読めません!