Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'encoding': 0.05; 'subject:skip:s 10': 0.07; 'string': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runs': 0.10; 'python': 0.11; '2.7.3': 0.16; 'accident.': 0.16; 'command,': 0.16; 'portable': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:f 60': 0.16; 'subject:key': 0.16; 'wrote:': 0.18; 'command': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'platform,': 0.24; 'string,': 0.24; 'header:X-Complaints-To:1': 0.27; 'code': 0.31; 'raw': 0.33; 'trouble': 0.34; 'but': 0.35; 'charset:us- ascii': 0.36; 'possible': 0.36; 'feed': 0.38; 'to:addr:python- list': 0.38; 'explain': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'forward': 0.65; 'directories,': 0.84; 'keystrokes': 0.84; 'skip:] 20': 0.84; 'subject:Send': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: Send alt key to subprocess.PIPE stdin Date: Wed, 11 Sep 2013 20:23:57 +0000 (UTC) References: <38b49476-607e-43ed-bd70-804ff8329ad0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 174.32.174.36 User-Agent: XPN/1.2.6 (Street Spirit ; Linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378931057 news.xs4all.nl 15893 [2001:888:2000:d::a6]:34881 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53991 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