subprocess.Popen on Windows

Werner F. Bruhin werner.bruhin at free.fr
Tue Oct 21 10:54:14 CEST 2008


Werner F. Bruhin wrote:
> I am trying to use subprocess - it basically works but.
>
>                    command =  'ping ' + '-n '+ str(count) + ' -l ' + 
> str(size) + ' ' + str(node)
>                    print command
>                    p = subprocess.Popen(command, stdin=subprocess.PIPE,
>                                                 stdout=subprocess.PIPE)
>                    pout = p.stdout.read()
>
> This works for me but I see the Windows command window, is there a way 
> to call subprocess without a command window showing?
>
> I am trying to replace:
>
> fdout, fdin = popen2.popen4('ping -n '+ str(count)+ ' -l '+ str(size) 
> +' '+node)
>
> Which did not show the command window.
>
> I did quit a bit of googling bug so far did not find an answer to my 
> problem.
>
> Appreciate any hints on how this can be accomplished.
A little while after I sent this I found the answer with google on 
activestate.

http://code.activestate.com/recipes/409002/

Werner



More information about the Python-list mailing list