use CTRL+L for clearing the screen

Ben Finney ben+python at
Wed Feb 29 12:39:22 CET 2012

Jabba Laci <jabba.laci at> writes:

> 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.

That sounds like a job for the standard library ‘readline’ module
<URL:>, an interface to the
widely-used C library of the same name on free operating systems.

 \         “We demand rigidly defined areas of doubt and uncertainty!” |
  `\    —Vroomfondel, _The Hitch-Hiker's Guide To The Galaxy_, Douglas |
_o__)                                                            Adams |
Ben Finney

More information about the Python-list mailing list