当前位置: 首页>>代码示例>>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;未经允许,请勿转载。