![](/img/trans.png)
[英]terminate/close cmd terminal while program is running using subprocess python
[英]How to clear cmd/terminal while running a python script
我一直看到在運行腳本時清除外殼的方法,但是在CMD中運行腳本時是否有清除屏幕的方法? 我當前的方法是這樣的:
clear.py
import title
def clear():
print('\n' * 25)
title.title()
game.py
from engine import clear
clear.clear()
print(Fore.CYAN + Style.BRIGHT + "--------------------------------")
但是,這種方法並不是真正可靠的,因為所有計算機上的某些cmd大小都不同,我也沒有在OSx上嘗試過。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.