On Fri, Jan 10, 2014 at 11:48 PM, daedae11 <daeda...@126.com> wrote:
> p = subprocess.Popen(['E:/EntTools/360EntSignHelper.exe',
> 'E:/build/temp/RemoteAssistSetup.exe'],
>                          stdout=subprocess.PIPE, shell=True).stdout

Is 360EntSignHelper supposed to run RemoteAssistSetup as a child
process? Or rather is it that from the command line you're piping the
output from the former into the latter? You'll need to provide more
information about what you mean by running the code "in command line".

Some general suggestions:

Remove shell=True. There's no reason to involve the shell here.
subprocess hides the window when you use shell=True, so maybe that's
why you're using it. But you can do that by setting the startupinfo
parameter to the following:

    si = subprocess.STARTUPINFO()
    si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
    si.wShowWindow = subprocess.SW_HIDE

Also, as a matter of style, `p` is a bad name for stdout. It's not an
instance of [P]open representing a process.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to