简体   繁体   English

清除Python IDLE shell中的行

[英]Clear line in the Python IDLE shell

Is there a keyboard shortcut to clear a line for the Python IDLE shell? 是否有键盘快捷键来清除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? 我知道如果你在一行的开头, Ctrl-K可以工作,但是当你在最后时有一个快捷方式吗?

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 Ca Ck . 如果将idle的Key SetIDLE Classic UnixOptions -> Configure -> Use a Built-in Key Set -> IDLE Classic Unix ),您至少可以使用Ca Ck获得相同的效果。 There doesn't seem to be anything that resembles Cu in Emacs, for example. 例如,似乎没有任何类似于Emacs中的Cu东西。

You could look into EditorWindow.py and configHandler.py if you're willing to add the functionality yourself (though it seems that Ck is a default binding in tk's editor widget). 如果你愿意自己添加功能,你可以查看EditorWindow.pyconfigHandler.py (尽管看起来Ck是tk编辑器小部件中的默认绑定)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM