Any way we can add configuration to python IDLE and assign it a shortcut, so when we use the shortcut a function call to clear the python IDLE screen? like print '\n' * 50, just to make a shortcut to clear the python IDLE. Suggestions welcome.
Asked
Active
Viewed 1,633 times
1
-
1How can it be a duplicate? The answer to that question is embedded in this question. – Scruffy Aug 11 '13 at 20:03
2 Answers
1
You can import os
and try os.system('clear')
to clear the screen rather than printing multiple \n
's. For Windows it would look like os.system('CLS')
as the commented (above) link suggests.

Matt
- 3,508
- 6
- 38
- 66
-
-
It doesn't work on my windows 7 and I am trying to make it a shortcut. Like if you press CTRL+L, your python IDLE on windows 7 will get clear. – iampranabroy Aug 13 '13 at 05:48
-
0
I think your only option might be using something like AutoHotKey:
An example for making a ctrl-r hotkey that would do what your asking with AutoHotKey is:
^r::SendInput print '\n' * 50 {Enter}
Just install AutoHotKey, put the above in a file called idle_clear.ahk, run the file, and your hotkey is active.

Scruffy
- 908
- 1
- 8
- 21