在python中清除屏幕 [英] Clear the screen in python

查看:29
本文介绍了在python中清除屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
python 中的清除终端

如何清除所有文本的窗口,使其看起来像是刚刚打开?

How can I clear the window for all text, so that it looks like it has just been opened?

我听说 os.system("clear") 有效,但没有.

I've heard os.system("clear") works, but it didn't.

在 Windows 7 上使用 Python 2.6.5

Using Python 2.6.5 on Windows 7

推荐答案

clear 适用于 linux,我相信.cls 应该可以解决问题:

clear is for linux, I believe. cls should do the trick:

os.system("cls")

这篇关于在python中清除屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆