在 Python 中清除终端 [英] Clear terminal in Python

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

问题描述

是否存在任何标准的自带电池"方法来清除 Python 脚本中的终端屏幕,或者我必须去诅咒(库,而不是单词)?

Does any standard "comes with batteries" method exist to clear the terminal screen from a Python script, or do I have to go curses (the libraries, not the words)?

推荐答案

转义序列呢?

print(chr(27) + "[2J")

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

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