Send alt key to subprocess.PIPE stdin

Gary Herron gherron at digipen.edu
Wed Sep 11 13:43:09 EDT 2013


On 09/11/2013 07:26 AM, Wanderer wrote:
> How do I send the command 'Alt+D' to subprocess.PIPE?
>
> My code is
>
> import subprocess
> rsconfig = subprocess.Popen(["C:\Program Files\Photometrics\PVCam64\utilities\RSConfig\RSConfig.exe", ],stdin=subprocess.PIPE)
>
> rsconfig.stdin.write('Alt+D')
>
> Thanks

That question doesn't really make sense.  A pipe provides a method to 
transfer a stream of bytes.  You could indeed send that byte across the 
pipe, but it's just a byte, written by one process and read by another 
process.  The receiving process can examine the byte stream, and do 
whatever it wants in response.

By calling it a _command_, you seem to expect some particular behavior 
out of the receiving process.  Please tell us *what* that might be, and 
we'll see what we can do to help out.

Gary Herron



-- 
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418




More information about the Python-list mailing list