From e3e021c014f9797d266eb84f5f449a2d3c718f32 Mon Sep 17 00:00:00 2001 From: annidyfeng Date: Fri, 29 Dec 2023 17:04:05 +0800 Subject: [PATCH] fix `cls` not exist on mac --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 1ecfb31..6b8c2d2 100644 --- a/main.py +++ b/main.py @@ -88,7 +88,10 @@ def display_info(): while True: try: time.sleep(5) - os.system("cls") + if os.name == 'nt': + os.system("cls") + elif os.name == 'posix': + os.system("clear") print(f"\r共监测{monitoring}个直播中", end=" | ") print(f"同一时间访问网络的线程数: {max_request}", end=" | ") if len(video_save_path) > 0: