From f0d189b9824ba98fcab1bbcb90ee76c52386e806 Mon Sep 17 00:00:00 2001 From: pskdje <77605497+pskdje@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20color=5Fcmd=5Fhandle.py=20?= =?UTF-8?q?=E4=BD=BFwindows=20cmd=E6=98=BE=E7=A4=BA=E9=A2=9C=E8=89=B2=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20https://github.com/tartley/colorama=20?= =?UTF-8?q?=E6=9D=A5=E6=98=BE=E7=A4=BA=E9=A2=9C=E8=89=B2=20=E8=AF=A5?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8F=AF=E8=83=BD=E4=B8=8D=E7=BB=8F=E5=B8=B8?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=EF=BC=8C=E8=AF=B7=E6=B3=A8=E6=84=8F=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blm/color_cmd_handle.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blm/color_cmd_handle.py b/blm/color_cmd_handle.py index cd60ebd..700bf55 100644 --- a/blm/color_cmd_handle.py +++ b/blm/color_cmd_handle.py @@ -11,6 +11,14 @@ except ImportError: ls_uid=-65536 +try:# 用于windows显示颜色 + import colorama # 该项目可能缺乏维护 + colorama.init() +except ImportError: + pass +except: + error("colorama启动失败") + def cbt(n):# 生成颜色操作 return f"\33[{n}m" def cfc(n):# 生成前景颜色