From ec298d485f2a082138ad6c8812198271a1878757 Mon Sep 17 00:00:00 2001 From: lxbhahaha <1580622474@qq.com> Date: Wed, 27 Mar 2024 13:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AC=AC=E4=BA=8C=E7=A7=8D?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=8B=89=E5=BC=BA?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/check.py b/check.py index a7ef60f..bfa570c 100644 --- a/check.py +++ b/check.py @@ -365,6 +365,7 @@ def realtime(args): parser.add_argument('-n', type=float, default=2, help='多久刷新一次') parser.add_argument('-e', '--exclude', type=str, default='', help='不需要显示的服务器(title)用,分割') parser.add_argument('-t', '--table', action='store_true', help='以表格形式绘制') + parser.add_argument('--f2', action='store_true', help='使用第二种刷新方式') args = parser.parse_args(args) except: print('参数有误!') @@ -397,7 +398,13 @@ def realtime(args): with data_list_lock: if args.table: res_str = get_table_res(data_list) - os.system('cls' if os.name == 'nt' else 'clear') + # 清屏 + if args.f2: + rows_full = os.get_terminal_size().lines + print("\033[F"*rows_full) + else: + os.system('cls' if os.name == 'nt' else 'clear') + # 输出 print(res_str) else: os.system('cls' if os.name == 'nt' else 'clear')