
我正在嘗試在 python 3.4.2 shell 上清除螢幕,我使用了清除螢幕、clear()、cls、clrscr 等。
答案1
CTRL+L應該做你想做的
答案2
import os
cls = lambda: os.system('cls')
cls()
答案3
有一個新的、非常簡單的 python 模組。
sudo pip3 install clear-shell
from clear_shell import clear
clear()
在我看來,打字clear()
更加容易和快速。