【发布时间】:2021-03-11 00:24:03
【问题描述】:
我在 Windows 上使用 pyCharm pro。
我几乎尝试了所有方法,但没有一个有效。
我也试过这些功能:
def screen_clear():
# for mac and linux(here, os.name is 'posix')
if os.name == 'posix':
_ = os.system('clear')
else:
# for windows platfrom
_ = os.system('cls')
使用这个 py 代码
i = 10
while i > 0:
print("X"*i)
i -= 1
sleep(1)
screen_clear()
及其给出的输出: Code Output
【问题讨论】:
-
是否只需按 Enter 键即可让所有内容都消失在您的视线范围内?毕竟即使有明确的命令,你也可以在向上滚动时看到以前的输出
标签: python cmd console python-3.8