Clear line in the Python IDLE shell

China☆狼群 提交于 2019-12-10 21:48:00

问题


Is there a keyboard shortcut to clear a line for the Python IDLE shell? I know Ctrl-K works if you are at the beginning of a line, but is there a shortcut to do it when you are at the end?


回答1:


If you set idle's Key Set to IDLE Classic Unix (Options -> Configure -> Use a Built-in Key Set -> IDLE Classic Unix) you'll at least be able to get the same effect with C-a C-k. There doesn't seem to be anything that resembles C-u in Emacs, for example.

You could look into EditorWindow.py and configHandler.py if you're willing to add the functionality yourself (though it seems that C-k is a default binding in tk's editor widget).



来源:https://stackoverflow.com/questions/13096329/clear-line-in-the-python-idle-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!