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


Groups > comp.lang.python > #53991

Re: Send alt key to subprocess.PIPE stdin

From Dave Angel <davea@davea.name>
Subject Re: Send alt key to subprocess.PIPE stdin
Date 2013-09-11 20:23 +0000
References <38b49476-607e-43ed-bd70-804ff8329ad0@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.263.1378931057.5461.python-list@python.org> (permalink)

Show all headers | View raw


On 11/9/2013 10:26, Wanderer wrote:

> How do I send the command 'Alt+D' to subprocess.PIPE?

That's not a command, it's a keystroke combination.  And without knowing
what RSConfig.exe is looking to get its keystrokes, it might not even be
possible to feed it any keystrokes via the pipe.

if the program does indeed use stdin, there's no portable encoding for
Alt-D.  But if your program only runs on one particular platform, you
might be able to find docs for that platform that explain it.

>
> My code is
>
> import subprocess
> rsconfig = subprocess.Popen(["C:\Program Files\Photometrics\PVCam64\utilities\RSConfig\RSConfig.exe", ],stdin=subprocess.PIPE)

That string will only work by accident.  You need to make it a raw
string, or use forward slashes, or double them.  As it happens, with
this PARTICULAR set of directories, you won't get into trouble with
Python 2.7.3



-- 
DaveA

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