Dan Sommers <d...@tombstonezero.net> writes: > 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.
Gregory Ewing <greg.ew...@canterbury.ac.nz> writes: > You might be able to do something with the termios module > to put the tty driver into the appropriate mode. > > If you do that, you'll have to be careful to set it back > again before the program exits for any reason, otherwise > your shell session will be messed up. Thank you both. Okay, ‘termios.tcgetattr’ will let me preserve the attributes, and with Dan Sommers's suggestion of which attribute to use, I may have a shot at setting the terminal attributes. Then with a top-level exception handler I can clean up by restoring the saved attributes with ‘termios.tcsetattr’. I will investigate along those lines. -- \ “Some people have a problem, and they think “I know, I'll use | `\ Perl!”. Now they have some number of problems but they're not | _o__) sure whether it's a string or an integer.” —Benno Rice, 2011 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list