En Tue, 19 Aug 2008 16:48:26 -0300, aditya shukla <[EMAIL PROTECTED]> escribi�:

I am using windows vista and i am trying to send data to the command prompt
,this is what is done.

import subprocess
proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE)
proc.communicate('abc')
when i run this the command prompt just blinks and disappears , can anyone
explain what's going on?

I don't have a Vista machine to test right now, but I'd expect the above sequence to hang indefinitely. If you want to execute something, don't forget the final \n
On XP this works fine:

import subprocess
proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE,stdout=subprocess.PIPE)
output = proc.communicate('dir\n')[0]
print repr(output)

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to