469,275 Members | 1,818 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

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 1050

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Darren Dale | last post: by
3 posts views Thread by madpython | last post: by
12 posts views Thread by Eric_Dexter | last post: by
25 posts views Thread by Jeremy Banks | last post: by
1 post views Thread by Mark Shewfelt | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.