No output from popen in Tkinter text widget

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin Walzer

    #1

    No output from popen in Tkinter text widget

    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.d estroy()

    self.passtext = self.passtext.g et()

    file = os.popen('echo %s | sudo -S /usr/sbin/tcpdump -v -i
    en1' % self.passtext, 'r')

    for line in file:
    self.t.insert(E ND, line)

    --
    Kevin Walzer
    Code by Kevin

  • John McMonagle

    #2
    Re: No output from popen in Tkinter text widget

    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.d estroy()
    >
    self.passtext = self.passtext.g et()
    >
    file = os.popen('echo %s | sudo -S /usr/sbin/tcpdump -v -i
    en1' % self.passtext, 'r')
    >
    for line in file:
    self.t.insert(E ND, line)
    >
    self.t.update()


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

    Comment

    Working...