• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pyfiglet.figlet_format函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyfiglet.figlet_format函数的典型用法代码示例。如果您正苦于以下问题:Python figlet_format函数的具体用法?Python figlet_format怎么用?Python figlet_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: handle

    def handle(self, *args, **options):
        print "Opening pokedex..."
        if options['pk']:
            pk = int(options['pk'])
        else:
            pk = randint(0,400)

        print pk

        response = requests.get("https://phalt-pokeapi.p.mashape.com/pokemon/%s/" % pk,
            headers={
                "X-Mashape-Key": "qEgnkvwWh4mshIfmA0n6zAbMPOjjp1Tlf7VjsntSR4MBqEosIl",
                "Accept": "application/json"
            }
        )
        pokemon = json.loads(response.content)
        urban = self.get_urban_dictionary_word(pokemon["name"])

        print ""
        print figlet_format(pokemon["name"], font="big")
        if urban["definition"]:
            print "--------------------------------------------------------------------------------"
            print urban["definition"]
            print ""
        print "%s" % urban["url"]

        if urban["photo"]:
            print urban["photo"]
            photo = StringIO(urllib.urlopen(urban["photo"]).read())
            print photo
            response = twitter_conn.upload_media(media=photo)
            twitter_conn.update_status(status=pokemon["name"], media_ids=[response['media_id']])
开发者ID:charlex,项目名称:nowcharleyworks,代码行数:32,代码来源:poke.py


示例2: main

def main():
    print figlet_format("sql-bool")
    parser = OptionParser(usage='Usage: python %prog [options]',version='%prog 1.2')
    parser.add_option("-u","--URL",action="store",
              type="string",dest="url",
              help="target url")
    parser.add_option("-D","--DB",action="store",
              type="string",dest="db_name",
              help="get database name")
    parser.add_option("-T","--TBL",action="store",
              type="string",dest="table_name",
              help="get table name")
    parser.add_option("-C","--COL",action="store",
              type="string",dest="column_name",
              help="get column name")
    parser.add_option("--dbs",action="store_true",
              dest="dbs",help="get all database name")
    (options,args) = parser.parse_args()

    if options == None or options.url == None:
        parser.print_help()
    elif options.column_name and options.table_name and options.db_name:
        getAllcontent(options.url,options.column_name,options.table_name,options.db_name)
    elif options.table_name and options.db_name:
        getAllColumnsByTable(options.url,options.table_name,options.db_name)
    elif options.db_name:
        getAllTablesByDb(options.url,options.db_name)    
    elif options.dbs:
        getAllDatabases(options.url)
    elif options.url:
        parser.print_help()
开发者ID:reber-9,项目名称:python,代码行数:31,代码来源:sqli_bool.py


示例3: winner

def winner(name=None):
    history.store_winner(name)

    if name is "draw":
        print(figlet_format("A  {0}!!!".format(name), font="big"))
    else:
        print(figlet_format("{0}  wins!!!".format(name), font="big"))
开发者ID:vorrtex,项目名称:vijigames,代码行数:7,代码来源:inout.py


示例4: getPasswords

def getPasswords():
  print "Unique passwords: " + executeQuery("db.session.distinct('auth_attempts.password').length")

  if verbose or veryVerbose:
    passwordList = executeQuery("db.session.aggregate([{\$unwind:'\$auth_attempts'},{\$group:{_id:'\$auth_attempts.password','count':{\$sum:1}}},{\$sort:{count:-1}}]).forEach(function(x){printjson(x)})").split('\n')
    for pair in passwordList:
      match = re.search(r'"_id" : "(.*)", "count" : (\d+) }',pair)
      if match:
        countByPassword[match.group(1)] = int(match.group(2))
    print figlet_format('Passwords', font='small')
    graph = Pyasciigraph()
    for line in  graph.graph('', sorted(countByPassword.items(), key=operator.itemgetter(1), reverse=True)):
      print(line)
    print
  else:
    passwordList = executeQuery("db.session.aggregate([{\$unwind:'\$auth_attempts'},{\$group:{_id:'\$auth_attempts.password','count':{\$sum:1}}},{\$sort:{count:-1}},{\$limit:10}]).forEach(function(x){printjson(x)})").split('\n')
    for pair in passwordList:
      match = re.search(r'"_id" : "(.*)", "count" : (\d+) }',pair)
      if match:
        countByPassword[match.group(1)] = int(match.group(2))
    print figlet_format('Passwords ( Top 10 )', font='small')
    graph = Pyasciigraph()
    for line in  graph.graph('', sorted(countByPassword.items(), key=operator.itemgetter(1), reverse=True)):
      print(line)
    print
开发者ID:haylesr,项目名称:mhn-scripts,代码行数:25,代码来源:stats.py


示例5: getPorts

def getPorts():
  print "Distinct ports attacked: " + executeQuery("db.session.distinct('destination_port').length")

  if verbose or veryVerbose:
    portList = executeQuery("db.session.aggregate({\$group:{_id:'\$destination_port','count':{\$sum:1}}},{\$sort:{count:-1}}).forEach(function(x){printjson(x)})").split('\n')
    for pair in portList:
      match = re.search(r'"_id" : (\d+), "count" : (\d+) }',pair)
      if match:
        countByPort[match.group(1)] = int(match.group(2))
    print figlet_format('Ports', font='small')
    graph = Pyasciigraph()
    for line in  graph.graph('', sorted(countByPort.items(), key=operator.itemgetter(1), reverse=True)):
      print(line)
    print
  else:
    portList = executeQuery("db.session.aggregate({\$group:{_id:'\$destination_port','count':{\$sum:1}}},{\$sort:{count:-1}},{\$limit:10}).forEach(function(x){printjson(x)})").split('\n')
    for pair in portList:
      match = re.search(r'"_id" : (\d+), "count" : (\d+) }',pair)
      if match:
        countByPort[match.group(1)] = int(match.group(2))
    print figlet_format('Ports ( Top 10 )', font='small')
    graph = Pyasciigraph()
    for line in  graph.graph('', sorted(countByPort.items(), key=operator.itemgetter(1), reverse=True)):
      print(line)
    print
开发者ID:haylesr,项目名称:mhn-scripts,代码行数:25,代码来源:stats.py


示例6: main

def main():
  print figlet_format('Stats!', font=fonts[random.randrange(len(fonts))])

  if geo or everything:
    getCountryStats()

  if address or everything:
    getAddresses()

  if ports or everything:
    getPorts()

  if usernames or credentials or everything:
    getUsernames()

  if passwords or credentials or everything:
    getPasswords()

  if honeypots or everything:
    getHoneypots()

  if malware or everything:
    getMalware()

  print "Total attacks: " + str(totalAttacks)
开发者ID:haylesr,项目名称:mhn-scripts,代码行数:25,代码来源:stats.py


示例7: getMalware

def getMalware():
  print "Malware samples: " + executeQuery("db.session.distinct('attachments.hashes.md5').length")
  
  print figlet_format('md5 hashes', font='small')
  md5List = executeQuery("db.session.distinct('attachments.hashes.md5')").split(',')
  i = 1
  for malware in md5List:
    print "     "+str(i)+": "+malware
    i = i + 1
开发者ID:haylesr,项目名称:mhn-scripts,代码行数:9,代码来源:stats.py


示例8: print_welcome

def print_welcome():
    from pyfiglet import figlet_format
    import time

    # big, doom, larry3d,starwars,slant, small,speed,mini, standard; script
    font = "straight"
    print figlet_format(' MORSE CODE ', font=font)
    print figlet_format('* KARAOKE *', font=font)
    time.sleep(4)
开发者ID:spbail,项目名称:morsecode-karaoke,代码行数:9,代码来源:karaoke_messages.py


示例9: intro

def intro():
	
	init(strip=not sys.stdout.isatty()) # strip colors if stdout is redirected
	cprint(figlet_format('kitty', font='starwars'),
       'white', 'on_red', attrs=['bold']) 
	cprint(figlet_format('the', font='starwars'),
       'white', 'on_red', attrs=['bold'])
	cprint(figlet_format('game', font='starwars'),
       'white', 'on_red', attrs=['bold'])
开发者ID:twostacks,项目名称:LPTHW,代码行数:9,代码来源:ex36.py


示例10: _ascii

 async def _ascii(self, *, text):
     msg = str(figlet_format(text, font='cybermedium'))
     if msg[0] == " ":
         msg = "." + msg[1:]
     error = figlet_format('LOL, that\'s a bit too long.',
                           font='cybermedium')
     if len(msg) > 2000:
         await self.bot.say(box(error))
     else:
         await self.bot.say(box(msg))
开发者ID:FishyFing,项目名称:Squid-Plugins,代码行数:10,代码来源:ascii.py


示例11: getHoneypots

def getHoneypots():
  honeypotList = executeQuery("db.session.aggregate({\$group:{_id:'\$honeypot','count':{\$sum:1}}},{\$sort:{count:-1}}).forEach(function(x){printjson(x)})").split('\n')
  for pair in honeypotList:
    match = re.search(r'"_id" : "(.*)", "count" : (\d+) }',pair)
    if match:
      attacksByHoneypot[match.group(1)] = int(match.group(2))
  print figlet_format('Honeypots', font='small')
  graph = Pyasciigraph()
  for line in  graph.graph('', sorted(attacksByHoneypot.items(), key=operator.itemgetter(1), reverse=True)):
    print(line)
  print
开发者ID:haylesr,项目名称:mhn-scripts,代码行数:11,代码来源:stats.py


示例12: __init__

		def __init__(self):

				self.last_epoch = self.get_last_epoch()
				if not self.last_epoch:
						cprint(figlet_format("No document exists in mongodb, STARTING FRESH :) ", font='mini'), attrs=['bold'])
						
				self.articles = self.fetch_articles_mongo()

				if not self.articles:
						cprint(figlet_format("No new documents beeds to updated to elastic search", font='mini'), attrs=['bold'])
				else:
						self.feed_elasticsearch()
				return 
开发者ID:vasugaur4,项目名称:machineLearning,代码行数:13,代码来源:elasticsearch_db.py


示例13: main

def main():
    print figlet_format("sqli-error")
    parser = OptionParser()
    parser.add_option("-u","--URL",action="store",
              type="string",dest="url",
              help="get url")
    parser.add_option("-D","--DB",action="store",
              type="string",dest="db_name",
              help="get database name")
    parser.add_option("-T","--TBL",action="store",
              type="string",dest="table_name",
              help="get table name")
    parser.add_option("-C","--COL",action="store",
              type="string",dest="column_name",
              help="get column name")

    parser.add_option("--dbs",action="store_true",
              dest="dbs",help="get all database name")
    parser.add_option("--current-db",action="store_true",
              dest="current_db",help="get current database name")
    parser.add_option("--current-user",action="store_true",
              dest="current_user",help="get current user name")
    parser.add_option("--tables",action="store_true",
              dest="tables",help="get tables from databases")
    parser.add_option("--columns",action="store_true",
              dest="columns",help="get columns from tables")
    parser.add_option("--dump",action="store_true",
              dest="dump",help="get value")
    (options,args) = parser.parse_args()

    
    # parser.print_help()
    # print options
    # print args

    if options == None or options.url == None:
        parser.print_help()
    elif options.dump and options.column_name and options.table_name and options.db_name:
        getAllcontent(options.url,options.column_name,options.table_name,options.db_name)
    elif options.table_name and options.db_name:
        getAllColumnsByTable(options.url,options.table_name,options.db_name)
    elif options.db_name:
        getAllTablesByDb(options.url,options.db_name)    
    elif options.dbs:
        getAllDatabases(options.url)
    elif options.current_db:
        getCurrentDb(options.url)
    elif options.current_user:
        getCurrentUser(options.url)
    elif options.url:
        print "you input: sqli-error.py -u www.xxx.com/?id=xx"
开发者ID:reber-9,项目名称:python,代码行数:51,代码来源:sqli_error.py


示例14: startupmessage

def startupmessage():
    print("Welcome. This is the rule booklet for the DPS East c0def3st")
    time.sleep (3)
    cleardeadbodies()
    print("Prepare well young 'un.")
    time.sleep(3)
    cleardeadbodies()
    time.sleep(4)
    cprint(figlet_format('        DPS              EAST     ', font='starwars'),
           'yellow', 'on_red', attrs=['bold'])
    print("PRESENTS:")
    time.sleep(4)
    cleardeadbodies()
    cprint(figlet_format(' c0de f3st', font='starwars'),
           'cyan', 'on_grey', attrs=['bold'])
开发者ID:srj940,项目名称:hackathon-dpse,代码行数:15,代码来源:hackathon_rules.py


示例15: instructions

def instructions(stdscr):
	
	# Title
	myscreen.clear()
	myscreen.addstr(1, 1, figlet_format('Code Breaker', font='big', justify = 'center'), curses.color_pair(3))

	# Instructions
	def calcx(string1):
		y, x = myscreen.getmaxyx()
		return int(x)/2-len(string1)/2

	line1 = "The objective of the game is to find the correct code."
	line2 = "The code is being automatically bruteforced on the left side of the screen."
	line3 = "The menu on the bottom-left lets you enter a range for the bruteforcer."
	line4 = "The menu on the right lets you try and test numbers."
	line5 = "If you test the right number or the bruteforcer finds it, you win."
	line6 = "Green numbers have 4 bits in common with the code, red numbers do not."
	line7 = "You are going to need a programmer's calculator to play this game."
	line8 = "One can be found by switching your computer's calculator to Programmer mode."
	line9 = "Press any key to go back to the main menu."

	myscreen.addstr(9, calcx(line1), line1)
	myscreen.addstr(10, calcx(line2), line2)
	myscreen.addstr(11, calcx(line3), line3)
	myscreen.addstr(12, calcx(line4), line4)
	myscreen.addstr(13, calcx(line5), line5)
	myscreen.addstr(14, calcx(line6), line6)
	myscreen.addstr(15, calcx(line7), line7)
	myscreen.addstr(16, calcx(line8), line8)
	myscreen.addstr(18, calcx(line9), line9, curses.color_pair(1)|curses.A_BOLD)

	# Press any key to continue
	myscreen.refresh()
	myscreen.getch()
	startScreen(stdscr)
开发者ID:B-Rich,项目名称:codeBreaker-3,代码行数:35,代码来源:codebreaker.py


示例16: cli

def cli(recursive, path):

    if not path:
        path = '.'

    click.clear()

    cprint(figlet_format('lsBranch', width=120), 'red')
    click.secho(' '*25 + 'by Ivan Arar', fg='red')

    lsbranch = lsBranch(path=path)

    click.echo()
    click.echo('-'*lsbranch.terminal_size)
    click.echo()

    lsbranch.search(recursive=recursive)

    click.echo('-'*lsbranch.terminal_size)
    click.echo()

    click.secho('Went through ' + str(lsbranch.counter_all()) + ' directories and found ' +
                str(lsbranch.counter_git()) + ' git repositories!', fg='blue', bold=True, blink=True)

    click.echo()
    click.echo('-'*lsbranch.terminal_size)
    click.echo()
开发者ID:arrrlo,项目名称:lsbranch,代码行数:27,代码来源:cli.py


示例17: ascii_art

def ascii_art(text):
    """
    Draw the Ascii Art
    """
    fi = figlet_format(text, font='doom')
    print('\n'.join(
        [next(g['cyc'])(i) for i in fi.split('\n')]
    ))
开发者ID:kiote,项目名称:rainbowstream,代码行数:8,代码来源:draw.py


示例18: banner

def banner():
	global version
	from pyfiglet import figlet_format
	b = figlet_format("      CROZONO") + \
	'''		Free Version - {v}
	www.crozono.com - [email protected]
	'''.format(v=version)
	print(b)
开发者ID:andy737,项目名称:crozono-free,代码行数:8,代码来源:crozono.py


示例19: font

 async def font(self, ctx, *, txt: str):
     """Change font for ascii. All fonts: http://www.figlet.org/examples.html for all fonts."""
     try:
         str(figlet_format('test', font=txt))
     except (FontError, FontNotFound):
         return await ctx.send(self.bot.bot_prefix + 'Invalid font type.')
     write_config_value("optional_config", "ascii_font", txt)
     await ctx.send(self.bot.bot_prefix + 'Successfully set ascii font.')
开发者ID:Fragzowns,项目名称:Discord-Selfbot,代码行数:8,代码来源:fun.py


示例20: print_score

def print_score(username, userscore):
    from pyfiglet import figlet_format
    import time
    # big, doom, larry3d,starwars,slant, small,speed,mini, standard; script
    print figlet_format('WELL DONE', font='straight')
    print figlet_format('{0}!'.format(username), font='straight')
    time.sleep(2)
    print figlet_format('YOUR SCORE:', font='straight')
    print figlet_format('{0} %!'.format(userscore), font='straight')
    time.sleep(3)
开发者ID:spbail,项目名称:morsecode-karaoke,代码行数:10,代码来源:karaoke_messages.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyfiglet.Figlet类代码示例发布时间:2022-05-25
下一篇:
Python module_urltitle.init函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap