No output from popen in Tkinter text widget

John McMonagle jmcmonagle at velseis.com.au
Mon Dec 11 18:17:29 EST 2006


Kevin Walzer wrote:
> I'm trying to display the output of an external process (invoked via
> popen) in a Tkinter text widget. I successfully start the process (based
> on what I'm seeing in my terminal output), but I can't get the output to
> display in the Tkinter widget. It seems to block.
> 
> Any ideas? My code is below:
> 
>     def runDump(self):
> 
>         self.password.destroy()
> 
>         self.passtext = self.passtext.get()
> 
>         file = os.popen('echo %s | sudo -S /usr/sbin/tcpdump  -v  -i
> en1' % self.passtext, 'r')
> 
>         for line in file:
>             self.t.insert(END, line)
> 

self.t.update()


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Python-list mailing list