<p>我正在尝试为wxpythongui实现一个进度条。我使用了EnhancedStatusBar(<a href="http://xoomer.virgilio.it/infinity77/main/EnhancedStatusBar.html" rel="nofollow noreferrer">http://xoomer.virgilio.it/infinity77/main/EnhancedStatusBar.html</a>)。我的代码如下所示:</p>
<pre><code>for line in iter(proc.stdout.readline, ''): #Read stdout line by line
self.gauge1.Pulse()
wx.CallAfter(self.write_to_textctrl, line) #Appends line variable to TextCtrl
</code></pre>
<p>我试过了自测规1.Destroy()就在for循环的外部,但它不起作用。那么当脉冲函数停止读取标准输出时,如何使它停止工作呢</p>