python类Back()的实例源码

cm_help.py 文件源码 项目:CManager 作者: fachrioktavian 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def show_help(self):
        help = 'dashboard section:\n'
        help += ' show interfaces          : Print all interfaces found by cmanager\n'
        help += ' wizard wifi              : Go to wifi wizard section\n'
        help += ' exit                     : Exit cmanager\n\n'
        help += 'wifi-wizard section:\n'
        help += ' show profile             : List profile that saved by cmanager\n'
        help += ' show options             : List available options used to create a profile\n'
        help += ' set [options] [value]    : Set value to available options before save the profile\n'
        help += ' save profile             : Save profile after options data\'s been filled\n'
        help += ' del profile [profile]    : Del profile by profile\'s name\n'
        help += ' use [wireless_intarface] : Use this command BEFORE scanning available network or connecting a profile\n'
        help += ' scan                     : Scanning available networks\n'
        help += ' connect [profile]        : Connecting wireless interface to a wifi network using specified profile\'s name\n'
        help += ' back                     : Back to dashboard section'

        print (Fore.GREEN + Style.BRIGHT + help)
debug.py 文件源码 项目:OpenMDAO 作者: OpenMDAO 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def _get_color_printer(stream=sys.stdout, colors=True):
    """
    Return a print function tied to a particular stream, along with coloring info.
    """
    try:
        from colorama import init, Fore, Back, Style
        init(autoreset=True)
    except ImportError:
        Fore = Back = Style = _NoColor()

    if not colors:
        Fore = Back = Style = _NoColor()

    def color_print(s, fore='', color='', end=''):
        """
        """
        print(color + s, file=stream, end='')
        print(Style.RESET_ALL, file=stream, end='')
        print(end=end)

    return color_print, Fore, Back, Style
cli.py 文件源码 项目:ggmt 作者: Granitosaurus 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def print_match(match, template):
    """wrapper to inject colorama colors to template"""
    click.echo(template.render(match, Fore=Fore, Back=Back))
color.py 文件源码 项目:grako 作者: apalala 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def init():
    try:
        import colorama

        global Fore, Back, Style
        Fore = colorama.Fore
        Back = colorama.Back
        Style = colorama.Style
        colorama.Fore
    except ImportError:
        pass


问题


面经


文章

微信
公众号

扫码关注公众号