当前位置: 首页>>代码示例>>Python>>正文


Python _curses.COLORS属性代码示例

本文整理汇总了Python中_curses.COLORS属性的典型用法代码示例。如果您正苦于以下问题:Python _curses.COLORS属性的具体用法?Python _curses.COLORS怎么用?Python _curses.COLORS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在_curses的用法示例。


在下文中一共展示了_curses.COLORS属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initscr

# 需要导入模块: import _curses [as 别名]
# 或者: from _curses import COLORS [as 别名]
def initscr():
    import _curses, curses
    # we call setupterm() here because it raises an error
    # instead of calling exit() in error cases.
    setupterm(term=_os.environ.get("TERM", "unknown"),
              fd=_sys.__stdout__.fileno())
    stdscr = _curses.initscr()
    for key, value in _curses.__dict__.items():
        if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
            setattr(curses, key, value)

    return stdscr

# This is a similar wrapper for start_color(), which adds the COLORS and
# COLOR_PAIRS variables which are only available after start_color() is
# called. 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:18,代码来源:__init__.py

示例2: start_color

# 需要导入模块: import _curses [as 别名]
# 或者: from _curses import COLORS [as 别名]
def start_color():
    import _curses, curses
    retval = _curses.start_color()
    if hasattr(_curses, 'COLORS'):
        curses.COLORS = _curses.COLORS
    if hasattr(_curses, 'COLOR_PAIRS'):
        curses.COLOR_PAIRS = _curses.COLOR_PAIRS
    return retval

# Import Python has_key() implementation if _curses doesn't contain has_key() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:12,代码来源:__init__.py


注:本文中的_curses.COLORS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。