• 欢迎光临~

杂:python_windows标准输出带颜色

开发技术 开发技术 2022-01-30 122次浏览

import ctypes

handle = ctypes.windll.kernel32.GetStdHandle(-11) # -11 for output   -10 for input   -12 for error

ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 0x01) # foreground=bule     0x10 background=blue

程序员灯塔
转载请注明原文链接:杂:python_windows标准输出带颜色
喜欢 (0)
违法和不良信息举报电话:022-22558618 举报邮箱:dljd@tidljd.com