华荣三照明、合信、荣欣八组合馈电

This commit is contained in:
冯佳
2025-06-25 11:36:43 +08:00
parent 37d39f4578
commit 25b3cb7f2e
494 changed files with 114074 additions and 0 deletions

41
print_color.py Normal file
View File

@ -0,0 +1,41 @@
from colorama import init, Fore, Back, Style
from threading import Lock
import datetime
init() # 初始化colorama
print_mutex = Lock()
def print_normal_msg(*args, **kwargs) :
current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
print_mutex.acquire()
print(current_time, *args, **kwargs, end='')
print(Style.RESET_ALL)
print_mutex.release()
def print_warning_msg(*args, **kwargs) :
current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
print_mutex.acquire()
print(current_time, Fore.LIGHTMAGENTA_EX, *args, **kwargs, end='')
print(Style.RESET_ALL)
print_mutex.release()
def print_inform_msg(*args, **kwargs) :
current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
print_mutex.acquire()
print(current_time, Fore.YELLOW, *args, **kwargs, end='')
print(Style.RESET_ALL)
print_mutex.release()
def print_error_msg(*args, **kwargs) :
current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
print_mutex.acquire()
print(current_time, Fore.RED, *args, **kwargs, end='')
print(Style.RESET_ALL)
print_mutex.release()
def print_debug_msg(*args, **kwargs) :
current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
print_mutex.acquire()
print(current_time, Fore.BLUE, *args, **kwargs, end='')
print(Style.RESET_ALL)
print_mutex.release()