本文整理汇总了Python中win32console.FOREGROUND_RED属性的典型用法代码示例。如果您正苦于以下问题:Python win32console.FOREGROUND_RED属性的具体用法?Python win32console.FOREGROUND_RED怎么用?Python win32console.FOREGROUND_RED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在模块win32console的用法示例。
在下文中一共展示了win32console.FOREGROUND_RED属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
点赞 6
# 需要导入模块: import win32console [as 别名]
# 或者: from win32console import FOREGROUND_RED [as 别名]
def __init__(self, stream):
import win32console
red, green, blue, bold = (win32console.FOREGROUND_RED,
win32console.FOREGROUND_GREEN,
win32console.FOREGROUND_BLUE,
win32console.FOREGROUND_INTENSITY)
self.stream = stream
self.screenBuffer = win32console.GetStdHandle(
win32console.STD_OUT_HANDLE)
self._colors = {'normal': red | green | blue,
'red': red | bold,
'green': green | bold,
'blue': blue | bold,
'yellow': red | green | bold,
'magenta': red | blue | bold,
'cyan': green | blue | bold,
'white': red | green | blue | bold}
开发者ID:openstack,项目名称:ec2-api,代码行数:19,
示例2: supported
点赞 6
# 需要导入模块: import win32console [as 别名]
# 或者: from win32console import FOREGROUND_RED [as 别名]
def supported(cls, stream=sys.stdout):
try:
import win32console
screenBuffer = win32console.GetStdHandle(
win32console.STD_OUT_HANDLE)
except ImportError:
return False
import pywintypes
try:
screenBuffer.SetConsoleTextAttribute(
win32console.FOREGROUND_RED |
win32console.FOREGROUND_GREEN |
win32console.FOREGROUND_BLUE)
except pywintypes.error:
return False
else:
return True
开发者ID:openstack,项目名称:ec2-api,代码行数:19,
示例3: __init__
点赞 6
# 需要导入模块: import win32console [as 别名]
# 或者: from win32console import FOREGROUND_RED [as 别名]
def __init__(self, stream):
from win32console import GetStdHandle, STD_OUTPUT_HANDLE, \
FOREGROUND_RED, FOREGROUND_BLUE, FOREGROUND_GREEN, \
FOREGROUND_INTENSITY
red, green, blue, bold = (FOREGROUND_RED, FOREGROUND_GREEN,
FOREGROUND_BLUE, FOREGROUND_INTENSITY)
self.stream = stream
self.screenBuffer = GetStdHandle(STD_OUTPUT_HANDLE)
self._colors = {
'normal': red | green | blue,
'red': red | bold,
'green': green | bold,
'blue': blue | bold,
'yellow': red | green | bold,
'magenta': red | blue | bold,
'cyan': green | blue | bold,
'white': red | green | blue | bold
}
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:20,
示例4: supported
点赞 6
# 需要导入模块: import win32console [as 别名]
# 或者: from win32console import FOREGROUND_RED [as 别名]
def supported(cls, stream=sys.stdout):
try:
import win32console
screenBuffer = win32console.GetStdHandle(
win32console.STD_OUTPUT_HANDLE)
except ImportError:
return False
import pywintypes
try:
screenBuffer.SetConsoleTextAttribute(
win32console.FOREGROUND_RED |
win32console.FOREGROUND_GREEN |
win32console.FOREGROUND_BLUE)
except pywintypes.error:
return False
else:
return True
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:19,
示例5: __init__
点赞 6
# 需要导入模块: import win32console [as 别名]
# 或者: from win32console import FOREGROUND_RED [as 别名]
def __init__(self, stream):
import win32console
red, green, blue, bold = (win32console.FOREGROUND_RED,
win32console.FOREGROUND_GREEN,
win32console.FOREGROUND_BLUE,
win32console.FOREGROUND_INTENSITY)
self.stream = stream
self.screenBuffer = win32console.GetStdHandle(
win32console.STD_OUT_HANDLE)
self._colors = {
'normal': red | green | blue,
'red': red | bold,
'green': green | bold,
'blue': blue | bold,
'yellow': red | green | bold,
'magenta': red | blue | bold,
'cyan': green | blue | bold,
'white': red | green | blue | bold
}
开发者ID:openstack,项目名称:glance_store,代码行数:21,
示例6: supported
点赞 6
# 需要导入模块: import win32console [as 别名]
# 或者: from win32console import FOREGROUND_RED [as 别名]
def supported(stream=sys.stdout):
try:
import win32console
screenBuffer = win32console.GetStdHandle(
win32console.STD_OUT_HANDLE)
except ImportError:
return False
import pywintypes
try:
screenBuffer.SetConsoleTextAttribute(
win32console.FOREGROUND_RED |
win32console.FOREGROUND_GREEN |
win32console.FOREGROUND_BLUE)
except pywintypes.error:
return False
else:
return True
开发者ID:openstack,项目名称:glance_store,代码行数:19,
示例7: __init__
点赞 6
# 需要导入模块: import win32console [as 别名]
# 或者: from win32console import FOREGROUND_RED [as 别名]
def __init__(self, stream):
from win32console import GetStdHandle, STD_OUT_HANDLE
from win32console import FOREGROUND_RED, FOREGROUND_BLUE
from win32console import FOREGROUND_GREEN, FOREGROUND_INTENSITY
red, green, blue, bold = (FOREGROUND_RED, FOREGROUND_GREEN,
FOREGROUND_BLUE, FOREGROUND_INTENSITY)
self.stream = stream
self.screenBuffer = GetStdHandle(STD_OUT_HANDLE)
self._colors = {
'normal': red | green | blue,
'red': red | bold,
'green': green | bold,
'blue': blue | bold,
'yellow': red | green | bold,
'magenta': red | blue | bold,
'cyan': green | blue | bold,
'white': red | green | blue | bold}
开发者ID:OpenState-SDN,项目名称:ryu,代码行数:19,
注:本文中的win32console.FOREGROUND_RED属性示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。