當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。