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


Groups > comp.lang.python > #106984

Re: Convert input to upper case on screen as it is typed

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Convert input to upper case on screen as it is typed
Date Thu, 14 Apr 2016 18:45:34 +1000
Lines 15
Message-ID <mailman.98.1460623542.15650.python-list@python.org> (permalink)
References <85oa9cyiqt.fsf@benfinney.id.au> <mailman.90.1460604334.15650.python-list@python.org> <nen5jj$hvi$1@dont-email.me> <85bn5cy6bz.fsf@benfinney.id.au> <8537qoy49y.fsf@benfinney.id.au> <CAPTjJmp=f2krZdYHphfWZRj5QkLpS6mPydAqT=WmPrGqUqWzeA@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de aXPm/4FtTK8Hy3iZ6Hci2Q/hz9A1nsI0p/UluTe/JEOQ==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; '*not*': 0.07; 'escape': 0.07; 'cc:addr:python-list': 0.09; 'yeah,': 0.09; 'thu,': 0.15; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:209.85.213.176': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Convert': 0.16; 'subject:case': 0.16; 'subject:screen': 0.16; 'wrote:': 0.16; 'working.': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'bit': 0.23; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; '14,': 0.27; 'readline': 0.29; "they'll": 0.29; "i'm": 0.30; 'probably': 0.31; 'stream': 0.33; 'wrap': 0.33; 'correctly': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'text': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'doing': 0.38; 'received:209': 0.38; 'rather': 0.39; 'some': 0.40; 'forget': 0.60; 'more': 0.63; 'wanting': 0.66; 'upper': 0.76; 'hoping': 0.77; 'low': 0.83; 'chrisa': 0.84; 'glad': 0.87; 'to:none': 0.91
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:cc :content-transfer-encoding; bh=oa0vJT9LyT2ZVVEOEbMlsMT0mSXJpZtFbTIMvp4jo2U=; b=ppIYGTp3VZs/CdO7WZzNMS6YXHA8G8DrFtlRMEmStw2IQx2QHnZf1M6CsTg8k7jkXU y0B4EQELat460HhPjgskGbnbtu3VwJR8sP1vKTo5GvTmhX9MaPX16m7WTbvg3rKHPFJ5 ORiIXDFLeH4n50wJWj8RhDuf1fXknQP55fNxa7QLE7hhLhnX8xgdzbvaf/Nk3GLs7soJ MwR5F9jB8SiZUCNUqQsA2LyKQb42o6qbPnrp/1cOiV5NdK9zLzttpVvPZd1IRm6XjQ5l H4OQlwKVmR95Ly6ItbWsahuFy7+4pMO3uKpA8DoilMaLBwE/9w9SGAMgFZNC+FNxza0D Tk8w==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-transfer-encoding; bh=oa0vJT9LyT2ZVVEOEbMlsMT0mSXJpZtFbTIMvp4jo2U=; b=VbI3IshBFCkWqA0XipfXs2yscPyj/c5LJNzLegcjdSYrW2mGXTRD8QQbXHiLgLiDoC vLdBSkyO1QCRB8OsOmXFAXlPgJHZKubdwNtqZgcs1i1KQzSEtTik2pmv5ewz2H0JXmdY cwFDai9qCeGMeuyQTzHobwYuNWh2Tx+m6d3G/ECA6VMXipIlwZ6XJIl1t2ZZ5jLLkjiM Kmkc5btNbt6xz2Oy85nNs/UD4gD16gcKHy6lqp0BnZgoRJsio/ApOfXvUBD68udSumvF AEN6cWzzR/jeQy9HRgW6qo+g5ibbF8j3E/JiBZJuan/rlMXB2Mj2yTiaH1NlBrLQNprS X90A==
X-Gm-Message-State AOPr4FW+iG4KA082icPhGV2f22mOLtNODllLWTBXYgvSvPuv0cMnxzUX5nCqcOAwsWRtASPwyymFkbvpMQ+K0g==
X-Received by 10.50.123.132 with SMTP id ma4mr11784964igb.92.1460623534407; Thu, 14 Apr 2016 01:45:34 -0700 (PDT)
In-Reply-To <8537qoy49y.fsf@benfinney.id.au>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
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>
X-Mailman-Original-Message-ID <CAPTjJmp=f2krZdYHphfWZRj5QkLpS6mPydAqT=WmPrGqUqWzeA@mail.gmail.com>
X-Mailman-Original-References <85oa9cyiqt.fsf@benfinney.id.au> <mailman.90.1460604334.15650.python-list@python.org> <nen5jj$hvi$1@dont-email.me> <85bn5cy6bz.fsf@benfinney.id.au> <8537qoy49y.fsf@benfinney.id.au>
Xref csiph.com comp.lang.python:106984

Show key headers only | View raw


On Thu, Apr 14, 2016 at 6:37 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
> I had been hoping that I could simply wrap some stream in a simple
> “convert what they actually type so it's upper case” text codec, without
> fiddling at such a low operating-system specific level. This is rather
> more esoteric than I had hoped.

If all you were doing was reading from stdin, then it probably would
be that easy. Wanting readline to work correctly requires a bit more
work; and don't forget that there are escape sequences that should
*not* be uppercased (as they'll change in meaning). So yeah, it's a
bit esoteric... but I'm glad it's working.

ChrisA

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


Thread

Convert input to upper case on screen as it is typed Ben Finney <ben+python@benfinney.id.au> - 2016-04-14 13:25 +1000
  Re: Convert input to upper case on screen as it is typed Dan Sommers <dan@tombstonezero.net> - 2016-04-14 04:16 +0000
    Re: Convert input to upper case on screen as it is typed Ben Finney <ben+python@benfinney.id.au> - 2016-04-14 15:17 +1000
      Re: Convert input to upper case on screen as it is typed Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-14 18:35 +1200
    Re: Convert input to upper case on screen as it is typed Ben Finney <ben+python@benfinney.id.au> - 2016-04-14 17:53 +1000
      Re: Convert input to upper case on screen as it is typed Steven D'Aprano <steve@pearwood.info> - 2016-04-14 21:43 +1000
    Re: Convert input to upper case on screen as it is typed Ben Finney <ben+python@benfinney.id.au> - 2016-04-14 18:37 +1000
      Re: Convert input to upper case on screen as it is typed Marko Rauhamaa <marko@pacujo.net> - 2016-04-14 12:22 +0300
    Re: Convert input to upper case on screen as it is typed Chris Angelico <rosuav@gmail.com> - 2016-04-14 18:45 +1000
    Re: Convert input to upper case on screen as it is typed Ben Finney <ben+python@benfinney.id.au> - 2016-04-19 05:11 +1000
      Re: Convert input to upper case on screen as it is typed Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-19 17:46 +1200

csiph-web