python subprocess know how

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

    python subprocess know how

    Hi,

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

    startupinfo = subprocess.STAR TUPINFO()
    startupinfo.dwF lags |= subprocess.STAR TF_USESHOWWINDO W
    my_process = subprocess.Pope n(cmnd, startupinfo=sta rtupinfo)
    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
  • Cameron Laird

    #2
    Re: python subprocess know how

    In article <997f0a34-6f38-4276-9107-2d5b725d1247@q2 6g2000prq.googl egroups.com>,
    King <animator333@gm ail.comwrote:
    >Hi,
    >
    >I am using subprocess module to execute a command and print results
    >back.
    >
    >startupinfo = subprocess.STAR TUPINFO()
    >startupinfo.dw Flags |= subprocess.STAR TF_USESHOWWINDO W
    >my_process = subprocess.Pope n(cmnd, startupinfo=sta rtupinfo)
    >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?

    Comment

    Working...