From 99effd2dd82450a161d466a15aa1bbcb29d7e5eb Mon Sep 17 00:00:00 2001 From: weiwei <2769694799@qq.com> Date: Tue, 17 Oct 2023 22:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=85=E5=B1=8F=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=9C=A8=E9=9D=9Ewin=E7=B3=BB=E7=BB=9F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/function.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/function.py b/src/function.py index eacf52a..3ca02d5 100644 --- a/src/function.py +++ b/src/function.py @@ -29,6 +29,7 @@ import os import re import requests +import platform from sys import exit from packaging import version @@ -377,4 +378,8 @@ def compare_versions(version1, version2): def clear_screen(): - os.system('cls') + # 根据系统类型执行不同的清屏指令 + if platform.system() == 'Windows': + os.system('cls') # Windows系统清屏命令 + else: + os.system('clear') # Unix/Linux/Mac系统清屏命令