本文整理汇总了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
示例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
示例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
示例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
示例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
示例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