【发布时间】:2014-03-31 10:20:03
【问题描述】:
我有一个 wxPython 脚本,它在单击按钮后执行一个进程,并在 wx.StaticText 中显示进程输出。 问题是当我想重新执行进程时,所以我点击按钮并显示旧结果(第一个进程的输出);这个旧结果仍然显示在窗口上,而我添加了一条通常会隐藏它的指令:
这是我的代码行:
def OnButton(self, e):
if self.res=="udpscan":
self.resultat1.SetLabel("")
ipad=self.ipadd.GetValue()
fromm=self.fr.GetValue()
too=self.to.GetValue()
ifc=self.intf.GetValue()
if len(ipad) <1 or len(too) < 1 or len(fromm) <1 or len(ifc) < 1:
wx.MessageBox('Please enter missing values','error',wx.OK)
else:
sp=subprocess.Popen(['python','udp_portscan.py',ifc,ipad,fromm,too],stdout=subprocess.PIPE)
text=sp.stdout.readlines()
text="".join(text)
self.resultat1.SetLabel(text)
我试图添加其他指令来隐藏它,但同样的问题。 你能帮我吗。谢谢你
【问题讨论】: