使用命令清除python idle

时间:2013-08-27 08:21:28

标签: python python-idle

我搜索了很多但找不到任何清除python空闲的命令(GUI) 任何人都可以帮助我,告诉我是否有任何命令来清除python IDLE。 非常感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

如果您正在使用命令行,则可以使用os清除窗口。请注意,Windows版本在Idle中不起作用,仅在Python shell中。如果您使用的是Windows,最好的方法就是输出适当数量的空行。

import os

os.system('clear')
os.system('CLS') # windows

# Solution for IDLE
N = 40 # you might need to adjust this
for i in range(N):
    print "\n"