我从这里的一个问题中获得了以下python类:
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
如果我正常运行python程序,我可以使用如下代码行:
print(color.BOLD + "Welcome to the game" + color.END)
它将以粗体和下划线打印
我使用以下代码让pyinstaller生成一个onefile exe
pyinstaller -c --onefile main.py
Pyinstaller很好地创建了这个文件,我可以运行它,但现在打印的代码相同:
←[1m
&←[0m
其中\033[1m
和\033[0m
是
预期产出为:
Welcome to the game
运行pyinstaller exe文件时的实际输出为:
←[1mWelcome to the game←[0m
有办法解决这个问题吗
谢谢
目前没有回答
相关问题 更多 >
编程相关推荐