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


Python Back.YELLOW属性代码示例

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


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

示例1: __init__

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def __init__(self):
        self.Q = read_questions()
        self.answers = {}
        self.instruction = Back.YELLOW + "There are a total of " +\
            "32 pairs of descriptions. For each pair, choose on a scale of " +\
            "1-5. Choose 1 if you are all the way to the left, and choose " +\
            "3 if you are in the middle, etc." + Style.RESET_ALL

        self.types = ['IE', 'SN', 'FT', 'JP']
        self.scoring_scheme = ((30, (15, 23, 27), (3, 7, 11, 19, 31)),
                               (12, (4, 8, 12, 16, 20, 32), (24, 28)),
                               (30, (6, 10, 22), (2, 14, 18, 26, 30)),
                               (18, (1, 5, 13, 21, 29), (9, 17, 25)))

        self.scores = []
        self.type = [] 
开发者ID:sukeesh,项目名称:Jarvis,代码行数:18,代码来源:personality.py

示例2: print_body_state

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def print_body_state(self, jarvis, bmi):
        """
        According the bmi number, print_body_state finds out the state of the body
        and prints it to the user using colorama library for some coloring
        """
        print("BMI:", str(bmi))
        if bmi < 16:
            print(Back.RED, " " * 2, Style.RESET_ALL)
            jarvis.say('Severe thinness')
        elif bmi < 18.5:
            print(Back.YELLOW, " " * 2, Style.RESET_ALL)
            jarvis.say('Mild thinness')
        elif bmi < 25:
            print(Back.GREEN, " " * 2, Style.RESET_ALL)
            jarvis.say('Healthy')
        elif bmi < 30:
            print(Back.YELLOW, " " * 2, Style.RESET_ALL)
            jarvis.say('Pre-obese')
        else:
            print(Back.RED, " " * 2, Style.RESET_ALL)
            jarvis.say('Obese') 
开发者ID:sukeesh,项目名称:Jarvis,代码行数:23,代码来源:bmi.py

示例3: print_highlighted

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def print_highlighted(line, hl_color=Back.WHITE):
    """
    Print a highlighted line
    """
    try:
        # Highlight positives
        colorer = re.compile(r'([^\s]+) POSITIVES: ([1-9]) ')
        line = colorer.sub(Fore.YELLOW + r'\1 ' + 'POSITIVES: ' + Fore.YELLOW + r'\2 ' + Style.RESET_ALL, line)
        colorer = re.compile(r'([^\s]+) POSITIVES: ([0-9]+) ')
        line = colorer.sub(Fore.RED + r'\1 ' + 'POSITIVES: ' + Fore.RED + r'\2 ' + Style.RESET_ALL, line)
        # Keyword highlight
        colorer = re.compile(r'([A-Z_]{2,}:)\s', re.VERBOSE)
        line = colorer.sub(Fore.BLACK + hl_color + r'\1' + Style.RESET_ALL + ' ', line)
        print(line)
    except Exception as e:
        pass 
开发者ID:Neo23x0,项目名称:munin,代码行数:18,代码来源:munin-host.py

示例4: printHighlighted

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def printHighlighted(line, hl_color=Back.WHITE, tag_color=False):
    """
    Print a highlighted line
    """
    if tag_color:
        # Tags
        colorer = re.compile('(HARMLESS|SIGNED|MS_SOFTWARE_CATALOGUE|MSSOFT|SUCCESSFULLY\sCOMMENTED)', re.VERBOSE)
        line = colorer.sub(Fore.BLACK + Back.GREEN + r'\1' + Style.RESET_ALL + '', line)
        colorer = re.compile('(REVOKED|EXPLOIT|CVE-[0-9\-]+|OBFUSCATED|RUN\-FILE)', re.VERBOSE)
        line = colorer.sub(Fore.BLACK + Back.RED + r'\1' + Style.RESET_ALL + '', line)
        colorer = re.compile('(EXPIRED|VIA\-TOR|OLE\-EMBEDDED|RTF|ATTACHMENT|ASPACK|UPX|AUTO\-OPEN|MACROS)', re.VERBOSE)
        line = colorer.sub(Fore.BLACK + Back.YELLOW + r'\1' + Style.RESET_ALL + '', line)
    # Extras
    colorer = re.compile('(\[!\])', re.VERBOSE)
    line = colorer.sub(Fore.BLACK + Back.LIGHTMAGENTA_EX + r'\1' + Style.RESET_ALL + '', line)
    # Add line breaks
    colorer = re.compile('(ORIGNAME:)', re.VERBOSE)
    line = colorer.sub(r'\n\1', line)
    # Standard
    colorer = re.compile('([A-Z_]{2,}:)\s', re.VERBOSE)
    line = colorer.sub(Fore.BLACK + hl_color + r'\1' + Style.RESET_ALL + ' ', line)
    print(line) 
开发者ID:Neo23x0,项目名称:munin,代码行数:24,代码来源:munin_stdout.py

示例5: yellow

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def yellow(s: str) -> str:  # pragma: no cover
    """Yellow color string if tty
    
    Args:
        s (str): String to color
    
    Returns:
        str: Colored string

    Examples:
        >>> from chepy.modules.internal.colors import yellow
        >>> print(YELLOW("some string"))
    """
    if sys.stdout.isatty():
        return Fore.YELLOW + s + Fore.RESET
    else:
        return s 
开发者ID:securisec,项目名称:chepy,代码行数:19,代码来源:colors.py

示例6: print_highlighted

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def print_highlighted(line, hl_color=Back.WHITE):
    """
    Print a highlighted line
    """
    # Tags
    colorer = re.compile('(HARMLESS|SIGNED|MS_SOFTWARE_CATALOGUE)', re.VERBOSE)
    line = colorer.sub(Fore.BLACK + Back.GREEN + r'\1' + Style.RESET_ALL + ' ', line)
    colorer = re.compile('(SIG_REVOKED)', re.VERBOSE)
    line = colorer.sub(Fore.BLACK + Back.RED + r'\1' + Style.RESET_ALL + ' ', line)
    colorer = re.compile('(SIG_EXPIRED)', re.VERBOSE)
    line = colorer.sub(Fore.BLACK + Back.YELLOW + r'\1' + Style.RESET_ALL + ' ', line)
    # Extras
    colorer = re.compile('(\[!\])', re.VERBOSE)
    line = colorer.sub(Fore.BLACK + Back.CYAN + r'\1' + Style.RESET_ALL + ' ', line)
    # Standard
    colorer = re.compile('([A-Z_]{2,}:)\s', re.VERBOSE)
    line = colorer.sub(Fore.BLACK + hl_color + r'\1' + Style.RESET_ALL + ' ', line)
    print line 
开发者ID:Neo23x0,项目名称:Loki,代码行数:20,代码来源:vt-checker.py

示例7: print_highlighted

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def print_highlighted(line, hl_color=Back.WHITE):
    """
    Print a highlighted line
    """
    try:
        # Highlight positives
        colorer = re.compile(r'([^\s]+) POSITIVES: ([1-9]) ')
        line = colorer.sub(Fore.YELLOW + r'\1 ' + 'POSITIVES: ' + Fore.YELLOW + r'\2 ' + Style.RESET_ALL, line)
        colorer = re.compile(r'([^\s]+) POSITIVES: ([0-9]+) ')
        line = colorer.sub(Fore.RED + r'\1 ' + 'POSITIVES: ' + Fore.RED + r'\2 ' + Style.RESET_ALL, line)
        # Keyword highlight
        colorer = re.compile(r'([A-Z_]{2,}:)\s', re.VERBOSE)
        line = colorer.sub(Fore.BLACK + hl_color + r'\1' + Style.RESET_ALL + ' ', line)
        print line
    except Exception, e:
        pass 
开发者ID:Neo23x0,项目名称:Loki,代码行数:18,代码来源:vt-checker-hosts.py

示例8: control

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def control(text):
        text = '\n<<< ' + str(text) + ' >>>\n\r'

        return Fore.YELLOW + text + Style.RESET_ALL if Color.is_atty() else text 
开发者ID:PayloadSecurity,项目名称:VxAPI,代码行数:6,代码来源:colors.py

示例9: control_without_arrows

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def control_without_arrows(text):
        text = str(text)

        return Fore.YELLOW + text + Style.RESET_ALL if Color.is_atty() else text 
开发者ID:PayloadSecurity,项目名称:VxAPI,代码行数:6,代码来源:colors.py

示例10: warning

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def warning(text):
        text = '\n\n<<< Warning: ' + str(text) + ' >>>\n'

        return Back.YELLOW + text + Style.RESET_ALL if Color.is_atty() else text 
开发者ID:PayloadSecurity,项目名称:VxAPI,代码行数:6,代码来源:colors.py

示例11: parseLine

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def parseLine(line):
    severity = getSeverity(line)

    # Add color based on severity
    if 'severity' not in locals():
        severity = 3

    if severity == 0:
        color = Style.DIM + Fore.WHITE
    elif severity == 1:
        color = Style.NORMAL + Fore.BLUE
    elif severity == 2:
        color = Style.NORMAL + Fore.CYAN
    elif severity == 3:
        color = Style.NORMAL + Fore.WHITE
    elif severity == 4:
        color = Style.NORMAL + Fore.RED
    elif severity == 5:
        color = Style.NORMAL + Fore.BLACK + Back.RED
    else:
        color = Style.NORMAL + Fore.BLACK + Back.YELLOW

    # Replace html tab entity with actual tabs
    line = clearTags(line)
    line = line.replace('&#09;', "\t")
    return color + line + Style.RESET_ALL 
开发者ID:screepers,项目名称:screeps_console,代码行数:28,代码来源:outputparser.py

示例12: traverse_next

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def traverse_next(page, nextx, results, tabular_data_headers=[], verbosity=0):
    """
    Recursive generator to traverse through the next attribute and \
    crawl through the links to be followed.

    :param page: The current page being parsed
    :param next: The next attribute of the current scraping dict
    :param results: The current extracted content, stored in a dict
    :return: The extracted content, through a generator

    """
    for link in page.extract_links(selector=nextx['follow_link']):
        if verbosity > 0:
            print('\n')
            print(Back.YELLOW + Fore.BLUE + "Loading page ", link.url + Back.RESET + Fore.RESET, end='')
        r = results.copy()
        for attribute in nextx['scraping'].get('data'):
            if attribute['field'] != "":
                if verbosity > 1:
                    print("\nExtracting", attribute['field'], "attribute", sep=' ', end='')
                r[attribute['field']] = link.extract_content(**attribute)
        if not nextx['scraping'].get('table'):
            result_list = [r]
        else:
            tables = nextx['scraping'].get('table', [])
            for table in tables:
                table.update({
                    'result': r,
                    'verbosity': verbosity
                })
                table_headers, result_list = link.extract_tabular(**table)
                tabular_data_headers.extend(table_headers)
        if not nextx['scraping'].get('next'):
            for r in result_list:
                yield (tabular_data_headers, r)
        else:
            for nextx2 in nextx['scraping'].get('next'):
                for tdh, result in traverse_next(link, nextx2, r, tabular_data_headers=tabular_data_headers, verbosity=verbosity):
                    yield (tdh, result) 
开发者ID:AlexMathew,项目名称:scrapple,代码行数:41,代码来源:config.py

示例13: yellow_background

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def yellow_background(s: str) -> str:  # pragma: no cover
    """Yellow color string if tty
    
    Args:
        s (str): String to color
    
    Returns:
        str: Colored string
    """
    if sys.stdout.isatty():
        return Back.YELLOW + Fore.BLACK + s + Fore.RESET + Back.RESET
    else:
        return s 
开发者ID:securisec,项目名称:chepy,代码行数:15,代码来源:colors.py

示例14: perror

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def perror(msg: Any, *, end: str = '\n', apply_style: bool = True) -> None:
        """Override perror() method from `cmd2.Cmd`

        Use colorama native approach for styling the text instead of `cmd2.ansi` methods

        :param msg: message to print (anything convertible to a str with '{}'.format() is OK)
        :param end: string appended after the end of the message, default a newline
        :param apply_style: If True, then ansi.style_error will be applied to the message text. Set to False in cases
                            where the message text already has the desired style. Defaults to True.
        """
        if apply_style:
            final_msg = "{}{}{}{}".format(Fore.RED, Back.YELLOW, msg, Style.RESET_ALL)
        else:
            final_msg = "{}".format(msg)
        ansi.ansi_aware_write(sys.stderr, final_msg + end) 
开发者ID:python-cmd2,项目名称:cmd2,代码行数:17,代码来源:colors.py

示例15: raw

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import YELLOW [as 别名]
def raw(self, msg, eol=None):
    if msg: print(Fore.YELLOW + msg + Style.RESET_ALL, end=eol)
    sys.stdout.flush()

  # show chit-chat 
开发者ID:RUB-NDS,项目名称:PRET,代码行数:7,代码来源:helper.py


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