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


Python Figlet.renderText方法代码示例

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


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

示例1: printTitle

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def printTitle():
    # 腳本頭部
    script_name = "NGINX vhost tools"
    f = Figlet()
    print f.renderText(script_name)
    print "Author: JackLam([email protected])"
    print ("-"*80)[:80]
开发者ID:lamjack,项目名称:useful-script,代码行数:9,代码来源:vhost.py

示例2: lunch_text

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def lunch_text():
    _version = pkg_resources.require("lunch")[0].version
    f = Figlet(font='smkeyboard')

    print f.renderText('LUNCH')
    print 'Lunch doesn\'t really do much of anything.'
    print 'Version ' + _version
    print 'Run lunch --help for a lacking list of arguments.'
开发者ID:rclarkburns,项目名称:lunch,代码行数:10,代码来源:welcome.py

示例3: hack

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
    def hack(self):
        os.system("cls")
        h = Figlet(font="cybermedium")
        print h.renderText("Hacker Routine")

        target = raw_input("Select a target: ").lower()

        routine = Routine(target)
        time.sleep(0.7)
        routine.main()
        print ""
开发者ID:darthmars97,项目名称:hacker,代码行数:13,代码来源:desktop.py

示例4: run

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
 def run(self):
     msg = 'Initializing framework v' + str(__version__)
     print '[+]', msg
     self.log.info(msg)
     f = Figlet(font='doom')
     print f.renderText('Framework')
     self.log.debug('System ' + sys.platform)
     self.log.debug('Version ' + sys.version)
     if not os.path.exists(self.output):
         os.makedirs(self.output)
     self._list_files()
     self._run_plugins()
开发者ID:Dhiraj3005,项目名称:Learning-Python-for-Forensics,代码行数:14,代码来源:framework.py

示例5: set_text_font

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def set_text_font(text, font):
    try:
        figlet = Figlet(font=font)
    except:
        print('weefig: no such font: %s' % (font))
        return ""
    return figlet.renderText(text)
开发者ID:emmettu,项目名称:weefig,代码行数:9,代码来源:weefig.py

示例6: logo

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def logo(version):
    """Print gprMax logo, version, and licencing/copyright information.
        
    Args:
        version (str): Version number.
    """
    
    licenseinfo = """
Copyright (C) 2015: The University of Edinburgh
           Authors: Craig Warren and Antonis Giannopoulos
        
gprMax is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
                    
gprMax is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
                                    
You should have received a copy of the GNU General Public License
along with gprMax.  If not, see <http://www.gnu.org/licenses/>."""
    width = 65
    url = 'www.gprmax.com'
    print('\n{} {} {}'.format('*'*round((width - len(url))/2), url, '*'*round((width - len(url))/2)))
    gprMaxlogo = Figlet(font='standard', width=width, justify='center')
    print('{}'.format(gprMaxlogo.renderText('gprMax')))
    print('{} v{} {}'.format('*'*round((width - len(version))/2), (version), '*'*round((width - len(version))/2)))
    print(licenseinfo)
    print('\n{}\n'.format('*'*(width+3)))
开发者ID:jjohnhhartley,项目名称:gprMax,代码行数:33,代码来源:utilities.py

示例7: inputAndTransform

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def inputAndTransform():
    dirPath =  os.curdir
    write = input("What do you want to write? Please input here:\n")
    f = Figlet(font='ogre') # 斜体 不slant是默认的字体 是不倾斜的
    textWrite = "```\n"+f.renderText(write)+"\n```"
    with open("codepic.txt", "w") as f:
        f.writelines(textWrite)
开发者ID:wendyltan,项目名称:localpractice,代码行数:9,代码来源:codeart.py

示例8: header

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def header():
    subprocess.call(['clear'])
    f = Figlet(font='slant')
    print('')
    print(colored(f.renderText(COMMAND_KEYWORD), 'red', attrs=['bold']))
    print('')
    print('')
开发者ID:maxvitek,项目名称:footman,代码行数:9,代码来源:footman.py

示例9: on_cmd

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
 def on_cmd(self, serv, ev, command, args, helper):
     u'''%(namespace)s <text> : écrit le texte donné en figlet. Ne gère que
     les caractères ASCII.'''
     f = Figlet()
     args.insert(0, command)
     message = ' '.join(args)
     figlet_msg = {}
     figlet_width = 0
     for c in message:
         figlet_c = f.renderText(c).split('\n')
         added_width = max(len(fc) for fc in figlet_c)
         # adding this character will make a too long line
         if figlet_width + added_width > self.width:
             # flush figlet message
             self.privfigletmsg(serv, helper['target'], figlet_msg)
             figlet_msg = {}
             figlet_width = 0
         # adding the character
         l = 0
         for fc in figlet_c:
             figlet_msg[l] = figlet_msg.get(l, '') + fc
             l += 1
         figlet_width += added_width
     # flush figlet message
     self.privfigletmsg(serv, helper['target'], figlet_msg)
开发者ID:gordonzola,项目名称:naobot,代码行数:27,代码来源:figlet.py

示例10: figlet_header

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def figlet_header(text, font='colossal', smushMode=None):
    """
    Prints text with ascii print driver.
    See available fonts with Figlet().getFonts()
    or pyfiglet.FigletFont.getFonts()
    Easy-to-read fonts include:
    * Doh       (very big)
    * Banner3   (Exclusively using '#')
    * Block     (rather subtil)
    * Colossal  (Easy to read, but set smushMode to 64 or lower for headers)
    * Georgia11 (Very elegant)
    * Roman
    * Univers
    """
    if Figlet is None:
        logger.warning("pyfiglet module not available.")
        return
    ## TODO: Add labfluence settings option to change font, etc.
    f = Figlet(font=font)
    if smushMode is not None:
        # pyfiglet default smushMode is calculated by pyfiglet.FigletFont.loadFont()
        # For some, e.g. colossal, the resulting smushMode of 128 smushes the characters a bit too much.
        # I've made a fork of pyfiglet where you can adjust smushMode directly
        # when instantiating a Figlet via argument fontkwargs.
        f.Font.smushMode = smushMode
    return f.renderText(text)
开发者ID:scholer,项目名称:labfluence,代码行数:28,代码来源:utils.py

示例11: crypto_2

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def crypto_2():
    f = Figlet(font='slant')
    print(f.renderText("Compression Session"))
    wrap_input("""Crypto 2 - Compression Session""")
    wrap_input("""NOTE: you may have to adjust the HOST and PORT in the script
that is about to be run if you are not using the default.""")
    wrap_shell_command(["./crypto_02.py"])
开发者ID:eqyiel,项目名称:comp3781,代码行数:9,代码来源:scripts.py

示例12: crypto_1

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def crypto_1():
    f = Figlet(font='slant')
    print(f.renderText("Standard Galactic Alphabet"))
    wrap_input("""Crypto 1 - Standard Galactic Alphabet""")
    wrap_input("""NOTE: you may have to adjust the HOST and PORT in the script
that is about to be run if you are not using the default.""")
    wrap_shell_command(["./crypto_01.py", "cat *"])
开发者ID:eqyiel,项目名称:comp3781,代码行数:9,代码来源:scripts.py

示例13: ascii_title

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def ascii_title():
    with term.location(0, 0):
        title_text = "Last  Layer  Algorithm  Trainer"
        f = Figlet(font="small", width=term.width)
        print(term.white(f.renderText(title_text)))
    with term.location(0, 5):
        print("─" * term.width)
    print(term.move_y(6))
开发者ID:jbwincek,项目名称:Llat,代码行数:10,代码来源:trainer.py

示例14: ConsoleApp

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
class ConsoleApp(CommandLineMixins):
    def __init__(self):
        self.ascii = Figlet(font='standard')
        self.modules = self.__get_module_dict()

    def start(self):
        while True:
            print(self.ascii.renderText('KTANE SOLVER'))
            choice = self.get_choice_or_quit(list(self.modules.keys()))
            if choice is None:
                break
            self.cls()
            print(self.ascii.renderText(choice))
            self.modules[choice].run()
            self.cls()

    def __get_module_dict(self):
        return { titleize(klass.__name__): klass() for klass in Module.__subclasses__() }
开发者ID:sshipsey,项目名称:ktane-py,代码行数:20,代码来源:console_app.py

示例15: textApi

# 需要导入模块: from pyfiglet import Figlet [as 别名]
# 或者: from pyfiglet.Figlet import renderText [as 别名]
def textApi(text=None):
    user_requested_font = request.args.get('font')
    font = getFont(user_requested_font)

    text = text or "Send us text!"
    fig = Figlet(font=font)
    ansi = fig.renderText(text)

    return format_request(ansi)
开发者ID:tarrant,项目名称:funtext,代码行数:11,代码来源:main.py


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