Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53981

Re: Send alt key to subprocess.PIPE stdin

Date 2013-09-11 10:43 -0700
From Gary Herron <gherron@digipen.edu>
Subject Re: Send alt key to subprocess.PIPE stdin
References <38b49476-607e-43ed-bd70-804ff8329ad0@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.257.1378921806.5461.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Send alt key to subprocess.PIPE stdin Wanderer <wanderer@dialup4less.com> - 2013-09-11 07:26 -0700
  Re: Send alt key to subprocess.PIPE stdin Nobody <nobody@nowhere.com> - 2013-09-11 18:18 +0100
  Re: Send alt key to subprocess.PIPE stdin Gary Herron <gherron@digipen.edu> - 2013-09-11 10:43 -0700
    Re: Send alt key to subprocess.PIPE stdin Wanderer <wanderer@dialup4less.com> - 2013-09-11 13:15 -0700
  Re: Send alt key to subprocess.PIPE stdin Dave Angel <davea@davea.name> - 2013-09-11 20:23 +0000
    Re: Send alt key to subprocess.PIPE stdin Wanderer <wanderer@dialup4less.com> - 2013-09-12 07:06 -0700
      Re: Send alt key to subprocess.PIPE stdin Chris Angelico <rosuav@gmail.com> - 2013-09-13 01:27 +1000
        Re: Send alt key to subprocess.PIPE stdin Nobody <nobody@nowhere.com> - 2013-09-12 18:20 +0100

csiph-web