Convert input to upper case on screen as it is typed

Chris Angelico rosuav at gmail.com
Thu Apr 14 04:45:34 EDT 2016


On Thu, Apr 14, 2016 at 6:37 PM, Ben Finney <ben+python at 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



More information about the Python-list mailing list