use CTRL+L for clearing the screen

Jabba Laci jabba.laci at
Wed Feb 29 11:01:16 CET 2012


I'm working on an interactive script. With raw_input user input is
read and the script produces some output and offers the prompt again.
I would like to add a clear screen feature, which would be activated
with CTRL+L. How to do that?
Another thing: raw_input waits until <Enter> but I'd like to clear the
screen at the moment when CTRL+L is pressed.

The script should be self-contained, thus I'd like to solve it by
using the standard library only.



More information about the Python-list mailing list