python subprocess know how

Cameron Laird claird at lairds.us
Sun Aug 31 12:24:06 EDT 2008


In article <997f0a34-6f38-4276-9107-2d5b725d1247 at q26g2000prq.googlegroups.com>,
King  <animator333 at gmail.com> wrote:
>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?
			.
			.
			.
<URL: http://wiki.python.org/moin/How_do_I_keep_a_GUI_alive_during_a_long-running_subprocess%3F >



More information about the Python-list mailing list