本文介绍了如何在wxPython中制作类似日志框的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我假设使用多行文本框可以做到这一点,但不确定如何做到这一点.我要做的是在wxPython程序中创建一个对话框,当某些操作发生时,我可以在其中写入消息.另外,我不仅需要在事件发生时写消息,还要在代码中的某些时候写消息.我如何重新绘制窗口,以便消息在那一刻出现?

I'm assuming this is possible with a multiline text box, but not sure how to do it. What I'm looking to do is make a log box in my wxPython program, where I can write messages to it when certain actions happen. Also, i need to write the messages not only when an event happens, but certain times in the code. How would i get it to redraw the window so the messages appear at that instant?

推荐答案

几年前,我写了一篇关于这种事情的文章:

I wrote an article on this sort of thing a couple years ago:

http://www.blog.pythonlibrary .org/2009/01/01/wxpython-redirecting-stdout-stderr/

这篇关于如何在wxPython中制作类似日志框的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 06:10