import sys
import platform
def printf(*objects, color="GREEN" ,sep=' ', end='\n', file=sys.stdout, flush=False):
if color=="red":
color_value = 31
elif color=="yellow":
color_value = 33
elif color=="blue":
color_value = 34
else:
color_value = 32
if(platform.system()=='Windows'):
import colorama
from colorama import init
init(autoreset=True)
print(f"\033[1;{color_value};40m"f'{objects[0]}')
else:
print(f"\033[0;{color_value}m", end="")
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
print("\033[0m", end="") #关闭所有属性
printf(5555555)
定制输出
最新推荐文章于 2024-02-26 16:11:58 发布