-- coding: UTF8 --
import os
import re
import wmi
import ctypes
import sys
STD_OUTPUT_HANDLE = -11
Windows CMD命令行 字体颜色定义 text colors
FOREGROUND_DARKGREEN = 0x02 # dark green.
FOREGROUND_RED = 0x0c # red.
FOREGROUND_GREEN = 0x0a # green.
FOREGROUND_BLUE = 0x09 # blue.
FOREGROUND_DARKRED = 0x04 # dark red.
reset white
def resetcolor():
set_cmd_text_color(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
暗绿色
def darkgreen(mess):
set_cmd_text_color(FOREGROUND_DARKGREEN)
sys.stdout.write(mess)
resetcolor()
暗红色
def darkred(mess):
set_cmd_text_color(FOREGROUND_DARKRED)
sys.stdout.write(mess)
resetcolor()