當前位置: 首頁>>代碼示例>>Python>>正文


Python Back.BLUE屬性代碼示例

本文整理匯總了Python中colorama.Back.BLUE屬性的典型用法代碼示例。如果您正苦於以下問題:Python Back.BLUE屬性的具體用法?Python Back.BLUE怎麽用?Python Back.BLUE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在colorama.Back的用法示例。


在下文中一共展示了Back.BLUE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: disp_err_corr

# 需要導入模塊: from colorama import Back [as 別名]
# 或者: from colorama.Back import BLUE [as 別名]
def disp_err_corr(hyp_corr, ref_corr):
    hyp_str = ''
    ref_str = ''
    assert len(hyp_corr) == len(ref_corr)
    for k in xrange(len(hyp_corr)):
        if hyp_corr[k] == '[space]':
            hc = ' '
        elif hyp_corr[k] == '<ins>':
            hc = Back.GREEN + ' ' + Back.RESET
        else:
            hc = hyp_corr[k]

        if ref_corr[k] == '[space]':
            rc = ' '
        elif ref_corr[k] == '<del>':
            rc = Back.RED + ' ' + Back.RESET
        else:
            rc = ref_corr[k]

        if hc != rc and len(hc) == 1 and len(rc) == 1:
            hc = Back.BLUE + Fore.BLACK + hc + Fore.RESET + Back.RESET
            rc = Back.BLUE + Fore.BLACK + rc + Fore.RESET + Back.RESET
        hyp_str += hc
        ref_str += rc
    print hyp_str
    print ref_str 
開發者ID:amaas,項目名稱:stanford-ctc,代碼行數:28,代碼來源:errorAnalysis.py

示例2: info

# 需要導入模塊: from colorama import Back [as 別名]
# 或者: from colorama.Back import BLUE [as 別名]
def info(self, msg, eol=None):
    if msg: print(Back.BLUE + msg + Style.RESET_ALL, end=eol)
    sys.stdout.flush()

  # show raw data 
開發者ID:RUB-NDS,項目名稱:PRET,代碼行數:7,代碼來源:helper.py

示例3: psdir

# 需要導入模塊: from colorama import Back [as 別名]
# 或者: from colorama.Back import BLUE [as 別名]
def psdir(self, isdir, size, mtime, name, otime):
    otime = Style.DIM + "(created " + otime + ")" + Style.RESET_ALL 
    vol = Style.DIM + Fore.YELLOW + item(re.findall("^(%.*%)", name)) + Style.RESET_ALL
    name = re.sub("^(%.*%)", '', name) # remove volume information from filename
    name = Style.BRIGHT + Fore.BLUE + name + Style.RESET_ALL if isdir else name
    if isdir: print("d %8s   %s %s %s %s" % (size, mtime, otime, vol, name))
    else:     print("- %8s   %s %s %s %s" % (size, mtime, otime, vol, name))

  # show directory listing 
開發者ID:RUB-NDS,項目名稱:PRET,代碼行數:11,代碼來源:helper.py

示例4: pjldir

# 需要導入模塊: from colorama import Back [as 別名]
# 或者: from colorama.Back import BLUE [as 別名]
def pjldir(self, name, size):
    name = name if size else Style.BRIGHT + Fore.BLUE + name + Style.RESET_ALL
    if size: print("- %8s   %s" % (size, name))
    else:    print("d %8s   %s" % ("-", name))

  # show directory listing 
開發者ID:RUB-NDS,項目名稱:PRET,代碼行數:8,代碼來源:helper.py

示例5: fuzzed

# 需要導入模塊: from colorama import Back [as 別名]
# 或者: from colorama.Back import BLUE [as 別名]
def fuzzed(self, path, cmd, opt):
      opt1, opt2, opt3 = opt
      if isinstance(opt1, bool): opt1 = (Back.GREEN + str(opt1) + Back.BLUE + "   ")\
                                 if opt1 else (Back.RED + str(opt1) + Back.BLUE + "  ")
      if isinstance(opt2, bool): opt2 = (Back.GREEN + str(opt2) + Back.BLUE + "   ")\
                                 if opt2 else (Back.RED + str(opt2) + Back.BLUE + "  ")
      if isinstance(opt3, bool): opt3 = (Back.GREEN + str(opt3) + Back.BLUE + "   ")\
                                 if opt3 else (Back.RED + str(opt3) + Back.BLUE + "  ")
      opt = opt1, opt2, opt3
      self.info("%-35s %-12s %-7s %-7s %-7s" % ((path, cmd) + opt))

  # show captured jobs 
開發者ID:RUB-NDS,項目名稱:PRET,代碼行數:14,代碼來源:helper.py

示例6: dump

# 需要導入模塊: from colorama import Back [as 別名]
# 或者: from colorama.Back import BLUE [as 別名]
def dump(self, data):
    # experimental regex to match sensitive strings like passwords
    data = re.sub(r"[\x00-\x06,\x1e]([!-~]{6,}?(?!\\0A))\x00{16}", "START" + r"\1" + "STOP", data)
    data = re.sub(r"\00+", "\x00", data) # ignore nullbyte streams
    data = re.sub(r"(\x00){10}", "\x00", data) # ignore nullbyte streams
    data = re.sub(r"([\x00-\x1f,\x7f-\xff])", ".", data)
    data = re.sub(r"START([!-~]{6,}?)STOP", Style.RESET_ALL + Back.BLUE + r"\1" + Style.RESET_ALL + Fore.YELLOW, data)
    self.raw(data, "")

  # dump ps dictionary 
開發者ID:RUB-NDS,項目名稱:PRET,代碼行數:12,代碼來源:helper.py


注:本文中的colorama.Back.BLUE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。