Browse Source

增加第二种刷新方式,勉强解决

master
lxbhahaha 1 year ago
parent
commit
ec298d485f
  1. 7
      check.py

7
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)
# 清屏
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')

Loading…
Cancel
Save