Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #54054
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-09-12 07:06 -0700 |
| References | <38b49476-607e-43ed-bd70-804ff8329ad0@googlegroups.com> <mailman.263.1378931057.5461.python-list@python.org> |
| Message-ID | <54dfa194-a84d-4b65-b9d8-1b26ec090fb3@googlegroups.com> (permalink) |
| Subject | Re: Send alt key to subprocess.PIPE stdin |
| From | Wanderer <wanderer@dialup4less.com> |
On Wednesday, September 11, 2013 4:23:57 PM UTC-4, Dave Angel wrote: > 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 Thanks, I didn't know that. I thought there would be some \n \t kind of combination or a unicode string for all the key combinations on my keyboard.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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