No output from popen in Tkinter text widget

K

Kevin Walzer

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)
 
J

John McMonagle

Kevin said:
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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top