Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Convert input to upper case on screen as it is typed Date: Thu, 14 Apr 2016 15:17:24 +1000 Lines: 20 Message-ID: References: <85oa9cyiqt.fsf@benfinney.id.au> <85k2k0ydjv.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de B746+Pxo66XpnD8osfePDARAC5H9U2hCoilQNZl4VXYg== Cancel-Lock: sha1:L5XqBaxYPIkxbJj+5PZsfYlz36o= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'thu,': 0.15; '2016': 0.16; 'invoking': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:Convert': 0.16; 'subject:case': 0.16; 'subject:screen': 0.16; 'suggestion.': 0.16; 'using,': 0.16; 'wrote:': 0.16; 'driver': 0.18; 'input': 0.18; 'keyboard': 0.22; "user's": 0.22; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'linux': 0.26; 'dan': 0.29; 'intellectual': 0.29; 'convert': 0.29; 'program,': 0.29; 'code': 0.30; 'run': 0.33; 'source': 0.33; 'lock': 0.33; 'case,': 0.34; 'done': 0.35; 'but': 0.36; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'received:org': 0.37; 'anything': 0.38; 'does': 0.39; 'area': 0.39; 'to:addr:python.org': 0.40; 'customer': 0.62; 'special': 0.73; 'upper': 0.76; '+1000,': 0.84; '_o__)': 0.84; 'received:125': 0.84; '\xe2\x80\x9cthe': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <85k2k0ydjv.fsf@benfinney.id.au> X-Mailman-Original-References: <85oa9cyiqt.fsf@benfinney.id.au> Xref: csiph.com comp.lang.python:106972 Dan Sommers writes: > On Thu, 14 Apr 2016 13:25:14 +1000, Ben Finney wrote: > > > How can my Python program convert the user's keyboard input to upper > > case, as though the user has CAPS LOCK enabled? > > I don't know which OS you're using, but if I run "stty olcuc" in my > Linux shell, then the input driver does that for me. Thanks for the suggestion. I need a solution that is specific to the Python program: it should only affect this program, and should not need anything special done to the terminal when invoking the program. -- \ “The whole area of [treating source code as intellectual | `\ property] is almost assuring a customer that you are not going | _o__) to do any innovation in the future.” —Gary Barnett | Ben Finney