471,573 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,573 software developers and data experts.

Re: subprocess.Popen on Windows

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.

Werner
Try:

p = subprocess.Popen(command, shell=True, tdin=subprocess.PIPE,
stdout=subprocess.PIPE)

was working on xp and osx
Oct 20 '08 #1
0 1184

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.