1

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.

iampranabroy
  • 1,716
  • 1
  • 15
  • 11

2 Answers2

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