python subprocess know how

Discussion in 'Python' started by King, Aug 31, 2008.

  1. King

    King Guest

    Hi,

    I am using subprocess module to execute a command and print results
    back.

    startupinfo = subprocess.STARTUPINFO()
    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
    my_process = subprocess.Popen(cmnd, startupinfo=startupinfo)
    print repr(my_process.communicate()[0])

    This code executes on pressing a button (wxPython). The problem is
    until command is not done
    and it's results are not printed, program halts and button keep the
    state of pushed.

    Is there any way to avoid this?

    Thanks
    King, Aug 31, 2008
    #1
    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. DP
    Replies:
    0
    Views:
    1,139
  2. Replies:
    7
    Views:
    363
    A.T.Hofkamp
    Sep 19, 2007
  3. hiral
    Replies:
    2
    Views:
    595
    Jean-Michel Pichavant
    May 5, 2010
  4. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    228
    Gregory Toomey
    Apr 23, 2004
  5. Aseem Bansal
    Replies:
    22
    Views:
    236
    Schneider
    Sep 26, 2013
Loading...

Share This Page