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


Python curses.ACS_URCORNER属性代码示例

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


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

示例1: box

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_URCORNER [as 别名]
def box(self, window, x, y, w, h, color):
        for i in xrange(1, w - 1):
            window.addch(y, x + i, curses.ACS_HLINE, color)
            window.addch(y + h - 1, x + i, curses.ACS_HLINE, color)
        for i in xrange(1, h - 1):
            window.addch(y + i, x, curses.ACS_VLINE, color)
            window.addch(y + i, x + w - 1, curses.ACS_VLINE, color)
        window.addch(y, x, curses.ACS_ULCORNER, color)
        window.addch(y, x + w - 1, curses.ACS_URCORNER, color)
        window.addch(y + h - 1, x, curses.ACS_LLCORNER, color)
        window.addch(y + h - 1, x + w - 1, curses.ACS_LRCORNER, color) 
开发者ID:Battelle,项目名称:sandsifter,代码行数:13,代码来源:sifter.py

示例2: _update_game_console

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_URCORNER [as 别名]
def _update_game_console(self, new_log_messages, console, paint_console):
    """Update game console text buffer; draw console to the screen if enabled.

    Args:
      new_log_messages: a list of strings containing new log messages to place
          in the game console's message buffer.
      console: curses window for the game console.
      paint_console: if True, the console will be displayed at the next screen
          refresh; if not, it won't.
    """
    # First we have to format the new messages to fit within our game console.
    rows, cols = console.getmaxyx()

    # Split all log messages on newline characters.
    split_log_messages = []
    for message in new_log_messages:
      split_log_messages.extend(message.splitlines())

    # It's a little weird to wrap console log messages with a text wrapper
    # designed for English text, but that beats writing tab expansion myself.
    wrapper = textwrap.TextWrapper(
        width=cols, drop_whitespace=False, break_on_hyphens=False)
    for message in split_log_messages:
      self._log_messages.extend(wrapper.wrap(message))

    # There's only room on the screen for the last rows-1 console messages.
    del self._log_messages[:(1-rows)]

    # Draw the console if the console is visible.
    if paint_console:
      console.border(' ', ' ', curses.ACS_HLINE, ' ',
                     curses.ACS_ULCORNER, curses.ACS_URCORNER, ' ', ' ')
      console.addstr(0, 4, '{ Console }', curses.A_BOLD)
      console.addstr(1, 0, '\n'.join(self._log_messages))
      console.noutrefresh() 
开发者ID:deepmind,项目名称:pycolab,代码行数:37,代码来源:human_ui.py

示例3: rectangle

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_URCORNER [as 别名]
def rectangle(win, uly, ulx, lry, lrx):
    """Draw a rectangle with corners at the provided upper-left
    and lower-right coordinates.
    """
    win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
    win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
    win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
    win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1)
    win.addch(uly, ulx, curses.ACS_ULCORNER)
    win.addch(uly, lrx, curses.ACS_URCORNER)
    win.addch(lry, lrx, curses.ACS_LRCORNER)
    win.addch(lry, ulx, curses.ACS_LLCORNER) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:14,代码来源:textpad.py


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