本文整理汇总了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']])
示例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()
示例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"))
示例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
示例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
示例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)
示例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
示例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)
示例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'])
示例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))
示例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
示例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
示例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"
示例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'])
示例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)