本文整理汇总了Python中pyfiglet.Figlet方法的典型用法代码示例。如果您正苦于以下问题:Python pyfiglet.Figlet方法的具体用法?Python pyfiglet.Figlet怎么用?Python pyfiglet.Figlet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyfiglet
的用法示例。
在下文中一共展示了pyfiglet.Figlet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parsingopt
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def parsingopt():
"""
Parsing and help function
"""
fig = Figlet(font='standard')
print(fig.renderText('CARPA'))
print('Author: ' + __author__)
print('Version: ' + __version__ + '\n')
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose',
action='store_true', help='Enable Debugging')
parser.add_argument('-p', metavar='<plugin.ini>', dest='pluginfd',
help='Plugin File (faraday.ini)')
parser.add_argument('-i', required=True,
metavar='<eth0>', dest='nic', help='Sniff Interface')
parser.add_argument('-f', required=True,
metavar='<file>', dest='fd', help='Output File')
if len(sys.argv) > 1:
try:
return parser.parse_args()
except IOError, msg:
parser.error(str(msg))
示例2: parsingopt
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def parsingopt():
f = Figlet(font='standard')
print(f.renderText('JAULA'))
print('Author: ' + __author__)
print('Version: ' + __version__ + '\n')
parser = argparse.ArgumentParser(add_help=True)
parser.add_argument('-v', '--verbose',
action='store_true', help='Enable debugging')
parser.add_argument('-i', required=True,
metavar='<wlan1>', dest='wnic', help='wlan int')
parser.add_argument('-f', required=True,
metavar='<file>', dest='fd', help='Output file')
if len(sys.argv) > 1:
try:
return parser.parse_args()
except IOError, msg:
parser.error(str(msg))
示例3: figletcmd
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def figletcmd(self, message):
""".figlet <font> <text>"""
# We can't localise figlet due to a lack of fonts
args = utils.get_args(message)
if len(args) < 2:
await utils.answer(message, self.strings["figlet_args"])
return
text = " ".join(args[1:])
mode = args[0]
if mode == "random":
mode = random.choice(FigletFont.getFonts())
try:
fig = Figlet(font=mode, width=30)
except FontNotFound:
await utils.answer(message, self.strings["no_font"])
return
await message.edit("<code>\u206a" + utils.escape_html(fig.renderText(text)) + "</code>")
示例4: __init__
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def __init__(self, text, font=DEFAULT_FONT, width=200):
"""
:param text: The text string to convert with Figlet.
:param font: The Figlet font to use (optional).
:param width: The maximum width for this text in characters.
"""
super(FigletText, self).__init__()
self._images = [Figlet(font=font, width=width).renderText(text)]
示例5: parsingopt
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def parsingopt():
f = Figlet(font='standard')
print(f.renderText('CIRCO'))
print('Author: ' + __author__)
print('Version: ' + __version__ + '\n')
parser = argparse.ArgumentParser(add_help=True)
command_group_mode = parser.add_mutually_exclusive_group(required=True)
parser.add_argument('-v', '--verbose', action='store_true',
help='Enable debugging')
command_group_mode.add_argument('-i', dest='nic', metavar='<eth0>',
help='Single Mode: <eth0>')
command_group_mode.add_argument('-b', '--bridge', action='store_true',
help='Bridge Mode: Use eth0 & eth1')
parser.add_argument('-A', '--ALL', action='store_true',
help='All exfiltration except wifi')
parser.add_argument('-p', '--ping', action='store_true',
help='PING exfiltration')
parser.add_argument('-t', '--trace', action='store_true',
help='Traceroute exfiltration')
parser.add_argument('-d', '--dns', action='store_true',
help='DNS exfiltration')
parser.add_argument('-w', '--web', action='store_true',
help='HTTP exfiltration')
parser.add_argument('-s', '--ssl', action='store_true',
help='HTTPS exfiltration')
parser.add_argument('-x', '--prx', action='store_true',
help='Proxy exfiltration')
parser.add_argument('-n', '--ntp', action='store_true',
help='NTP exfiltration')
parser.add_argument('-a', dest='wnic', metavar='<wlan1>',
help='Wireles exfiltration')
if len(sys.argv) > 1:
try:
return parser.parse_args()
except IOError, msg:
parser.error(str(msg))
示例6: print_logo
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def print_logo(text_logo):
figlet = Figlet(font='slant')
print(figlet.renderText(text_logo))
# parse positional and optional arguments
示例7: ascii
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def ascii(self, key, font='smslant', lineformat=""):
try:
if not config['show-ascii-art-text']:
await self.message(self.channel, key)
return ''
except KeyError:
logging.warning("Plz set the show-ascii-art-text config. kthx")
try:
lines = [lineformat + name for name in Figlet(font).renderText(key).split("\n")[:-1] if name.strip()]
except:
# We're looking to catch any "pyfiglet.FontNotFound" exceptions
logging.error("You need to install extra fonts from http://www.jave.de/figlet/fonts.html by downloading the zipfile and then running pyfiglet -L <NameOfZipFile>")
await self.message(self.channel, key)
return ''
await self.message(self.channel, "\n".join(lines))
示例8: time_now
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def time_now():
'''
Return current time in Figlet format.
'''
time_heading = '===============Time===============\n'
now = datetime.datetime.now().strftime("%H:%M")
f = Figlet(font='doom')
time_details = f.renderText(now).rstrip() + '\n'
return (time_heading + time_details).decode('utf-8')
示例9: __init__
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def __init__(self, opts):
self.opts = opts
self.ok = 0
self.fail = 0
self.failed = []
self.oked = []
self.skip = ['runic','pyramid','eftifont'] # known bug..
self.f = Figlet()
示例10: banner
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def banner(text):
cprint(Figlet().renderText(text), "blue")
示例11: rd
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def rd(text, on_color=None, attr=None,
width=80, justify="center"):
"""An art font that generates random fonts
and random colors.
Args:
text: Get an character string.
color: Get a color string,dye the input string
with the corresponding color.
available text colors:
red, green, yellow, blue, magenta, cyan, white.
on_color: Get an character string,setting the background
color of the text.
available text highlights:
on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan,
on_white.
attr: Get a character string,setting the effect of the text.
available attributes:
bold, dark, underline, blink, reverse, concealed.
width: Setting the terminal width of the output font, type is int.
justify: Setting the location of the terminal output font.
available parameter: left, enter, right.
Returns:
A text of a specific color effect.
"""
rand_int = random.randint(1, len(font_list)+1)
rand_color = color_dict.get(random.randint(30, 38))
rand_font = font_list[rand_int]
print("Random font is :{}".format(rand_font))
f = Figlet(
font=rand_font, width=width,
justify=justify
)
r = f.renderText(text)
return colored(r, rand_color, on_color, attr)
示例12: gt
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def gt(text, font=DEFAULT_FONT, color="magenta",
on_color=None, attr=None, width=80,
justify="center"):
"""An art font that generates the effect of
the specified parameter.
Args:
text: Get an character string.
on_color: Get an character string,setting the background
color of the text.
available text highlights:
on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan,
on_white.
attr: Get a character string,setting the effect of the text.
available attributes:
bold, dark, underline, blink, reverse, concealed.
width: Setting the size of the terminal output font, type is int.
justify: Setting the location of the terminal output font.
available parameter: left, enter, right.
Returns:
A text of a specific color effect.
"""
f = Figlet(
font, width=width,
justify=justify
)
r = f.renderText(text)
return colored(r, color, on_color, attr)
示例13: figlet
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def figlet(self, ctx: Context, text: str, font=None):
"""Convert text to ascii art."""
if font is None:
font = 'slant'
if font == 'random':
fonts = FigletFont.getFonts()
font = random.choice(fonts)
f = Figlet(font=font)
out = f.renderText(text)
for page in pagify(out, shorten_by=24):
await self.bot.say(box(page))
示例14: figletrandom
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def figletrandom(self, ctx: Context, text: str):
"""Convert text to ascii art using random font."""
font = random.choice(FigletFont.getFonts())
f = Figlet(font=font)
out = f.renderText(text)
for page in pagify(out, shorten_by=24):
await self.bot.say(box(page))
await self.bot.say("Font: {}".format(font))
示例15: run
# 需要导入模块: import pyfiglet [as 别名]
# 或者: from pyfiglet import Figlet [as 别名]
def run(self):
msg = 'Initializing framework'
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()