【发布时间】:2020-08-11 16:47:17
【问题描述】:
我使用的是 Windows 10、Python 3.8。我正在尝试清除 shell 中的所有内容,但我使用的代码似乎不起作用。
这是我的代码:
import os
print("Erase This Text")
os.system('cls')
os.system('clear') #This is used for Linux, but I tried it just incase
【问题讨论】:
-
os.system('cls')应该可以在 Windows 上运行。查看How to clear the interpreter console?的答案
标签: python windows operating-system