No output from popen in Tkinter text widget

Discussion in 'Python' started by Kevin Walzer, Dec 11, 2006.

  1. Kevin Walzer

    Kevin Walzer Guest

    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)

    --
    Kevin Walzer
    Code by Kevin
    http://www.codebykevin.com
    Kevin Walzer, Dec 11, 2006
    #1
    1. Advertising

  2. 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.
    John McMonagle, Dec 11, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. T. Kaufmann
    Replies:
    0
    Views:
    354
    T. Kaufmann
    Jul 9, 2003
  2. dmitrey
    Replies:
    0
    Views:
    1,087
    dmitrey
    Oct 14, 2008
  3. Frederic Rentsch
    Replies:
    0
    Views:
    240
    Frederic Rentsch
    Jul 8, 2012
  4. Terry Reedy
    Replies:
    15
    Views:
    633
    Frederic Rentsch
    Jul 16, 2012
  5. Frederic Rentsch
    Replies:
    0
    Views:
    428
    Frederic Rentsch
    Jul 9, 2012
Loading...

Share This Page