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


Groups > comp.lang.python > #54056

Re: Send alt key to subprocess.PIPE stdin

Path csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'string.': 0.05; 'subject:skip:s 10': 0.07; 'though:': 0.07; 'string': 0.09; 'character,': 0.09; 'escape': 0.09; 'gui': 0.12; '"a"': 0.16; 'character.': 0.16; 'combinations': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'keypress': 0.16; 'sorts': 0.16; 'subject:key': 0.16; 'tool.': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'app': 0.19; "aren't": 0.24; 'controlling': 0.24; 'instance,': 0.24; 'typical': 0.24; 'unicode': 0.24; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; '13,': 0.31; 'sep': 0.31; 'fri,': 0.33; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'combination': 0.36; 'done': 0.36; "didn't": 0.36; 'represent': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'system.': 0.39; 'either': 0.39; 'even': 0.60; 'most': 0.60; 'simple': 0.61; 'kind': 0.63; 'between': 0.67; 'keystrokes': 0.84; 'subject:Send': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Kk3fue99xcHXUmbWcd8Znarw0AvojdXPqd2CEXvRtqY=; b=hmCZfvmzSjddKxaHqeTDJyLNSeDorJOLocvGTfIo1uHpCl+kVafNzdlrXnD3uxGeqv LJUjo+qG5YiGTrE/Vnm3NxvHxG/J/4vdyMrHVQVQb2HQGOFDwN4DKlMDysoh03n70i2G eVg3WdhvbcEg4RaDlltInyc2rlnefSqpb1tfyMWgTbtnxz4tNZHtHtBvLrsAw6CjrEoH YejXKZRnH+DP68ucGzJA7v+YGkjMzSmoV+yDt+DB1ilQvXzWuV3rHolBgdSBjxQ54rXk OIu9UImAg2O2d4Y301cpVFB35wBqzMnjjJDPyvNhVzgrPOGLGVA4xz7IGu22x62KIF/A Z6zg==
MIME-Version 1.0
X-Received by 10.68.234.165 with SMTP id uf5mr8323022pbc.41.1378999673890; Thu, 12 Sep 2013 08:27:53 -0700 (PDT)
In-Reply-To <54dfa194-a84d-4b65-b9d8-1b26ec090fb3@googlegroups.com>
References <38b49476-607e-43ed-bd70-804ff8329ad0@googlegroups.com> <mailman.263.1378931057.5461.python-list@python.org> <54dfa194-a84d-4b65-b9d8-1b26ec090fb3@googlegroups.com>
Date Fri, 13 Sep 2013 01:27:53 +1000
Subject Re: Send alt key to subprocess.PIPE stdin
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.313.1378999677.5461.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1378999677 news.xs4all.nl 15868 [2001:888:2000:d::a6]:54828
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:54056

Show key headers only | View raw


On Fri, Sep 13, 2013 at 12:06 AM, Wanderer <wanderer@dialup4less.com> wrote:
> 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.

Unicode identifies every character, but keystrokes aren't characters.
Consider, for instance, the difference between the keypress Shift+A
and the letter produced - even in the most simple ASCII-only US-only
situation, that could produce either "A" or (if Caps Lock is active)
"a". So if you actually want to trigger Shift+A, you can't represent
that with a character. Controlling a GUI app has to be done with
keystrokes, so it needs a GUI controlling tool.

That said, though: These sorts of keystrokes often can be represented
with escape sequences (I just tried it in xterm and Alt-D came out as
"\e[d"), so you could control a console program using sequences that
you could put into a string. But that's not true of your typical GUI
system.

ChrisA

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