def _show_log(self, event):
    self.log_window.Show()

def _log_message(self, event):
    wx.LogError('New error message')

def _on_close(self, event):
    self.log_window.this.disown()
wx.Log.SetActiveTarget(None)
event.Skip()
if __name__ == '__main__':
    app = wx.PySimpleApp()
dlg = MainWindow()
dlg.Show()
app.MainLoop()
How to make something like a log box in wxPython