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


Python pyfiglet.figlet_format函数代码示例

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


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


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