我在Windows XP SP3上使用MINGW / BASH。
(在.pythonstartup坚持这一点)
#我CTRL-L已经样的工作,但是这可能帮助别人
#树叶窗口虽然...的底部提示
导入的ReadLine
readline.parse_and_bind(“氯\:清屏”)
#这在BASH中有效,因为我也在.inputrc中也有它,但是由于某些
原因,当我进入Python
readline 时它被丢弃了('\ Cy:kill-whole-line')
我再也无法忍受键入'exit()'了,对martineau / Triptych的把戏感到满意:
我虽然稍加修改(将其粘贴在.pythonstartup中)
class exxxit():
"""Shortcut for exit() function, use 'x' now"""
quit_now = exit # original object
def __repr__(self):
self.quit_now() # call original
x = exxxit()
Py2.7.1>help(x)
Help on instance of exxxit in module __main__:
class exxxit
| Shortcut for exit() function, use 'x' now
|
| Methods defined here:
|
| __repr__(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| quit_now = Use exit() or Ctrl-Z plus Return to exit