def user_greeting(pamh, user_info): from pyfiglet import Figlet f = Figlet(font='letter') banner = f.renderText('Hi %s!' % user_info['first_name']) pamh.conversation(pamh.Message(pamh.PAM_TEXT_INFO, str(""" ------------------------------------------------------------------- %s (c) 2015-04-01 Jens Erat <*****@*****.**>, MIT license Code on GitHub: https://github.com/JensErat/ssh-facebookauth ------------------------------------------------------------------- """ % banner)))
def printTitle(): # 腳本頭部 script_name = "NGINX vhost tools" f = Figlet() print f.renderText(script_name) print "Author: JackLam([email protected])" print ("-"*80)[:80]
def header(): subprocess.call(['clear']) f = Figlet(font='slant') print('') print(colored(f.renderText(COMMAND_KEYWORD), 'red', attrs=['bold'])) print('') print('')
def set_text_font(text, font): try: figlet = Figlet(font=font) except: print('weefig: no such font: %s' % (font)) return "" return figlet.renderText(text)
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)))
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)
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)
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)
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"])
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 *"])
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))
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.'
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)
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')
def startupMessage(self): ''' Spiffy looking startup banner.' ''' figlet = Figlet(font='slant') for line in figlet.renderText('sevcol IO\ngateway').splitlines(): self.log.info(line) self.log.info('Version %s' % VERSION)
def main(): parser = OptionParser(version=__version__) parser.add_option('-s', '--show', action='store_true', default=False, help='pause at each failure and compare output ' '(default: %default)') opts, args = parser.parse_args() f = Figlet() ok = 0 fail = 0 failed = [] skip = ['runic'] # known bug.. for font in f.getFonts(): if font in skip: continue f.setFont(font=font) outputPyfiglet = f.renderText('foo') fontpath = os.path.join('pyfiglet', 'fonts', font) if os.path.isfile(fontpath + '.flf'): cmd = ('figlet', '-d', 'pyfiglet/fonts', '-f', font, 'foo') elif os.path.isfile(fontpath + '.tlf'): cmd = ('toilet', '-d', 'pyfiglet/fonts', '-f', font, 'foo') else: raise Exception('Missing font file: '+fontpath) p = Popen(cmd, bufsize=1,stdout=PIPE) outputFiglet = p.communicate()[0].decode('ascii', 'replace') if outputPyfiglet == outputFiglet: print('[OK] %s' % font) ok += 1 continue print('[FAIL] %s' % font) fail += 1 failed.append(font) if opts.show is True: print('[PYTHON] *** %s\n\n' % font) dump(outputPyfiglet) print('[FIGLET] *** %s\n\n' % font) dump(outputFiglet) raw_input() print('OK = %d, FAIL = %d' % (ok, fail)) if len(failed) > 0: print('FAILED = %s' % repr(failed)) return 0
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 ""
def get_figlet_text(text): """ Returns a big "ascii art"-like text spelling the words in text. """ font = 'colossal' # This is case *sensitive* (on *nix and if pyfiglet is zipped). try: printer = Figlet(font) except NameError: print("ERROR, could not import pyfiglet, big text not available.") print("sys.path=", sys.path) return text printer.Font.smushMode = 64 return printer.renderText(text)
def greeting(self): try: data = self.driver.find_element_by_xpath("//*[contains(text(), 'Logout')]") f = Figlet(font="slant") self.name = re.search("\((.*?)\)", data.text).group( 1 ) # Extracts username from 'Logout (username)' fetched from the page. print(f.renderText(self.name)) self.name = self.name.lower() except NoSuchElementException: pass
def print_rolled(dice): holds = [' {} ']*len(dice) for d in range(len(dice)): if is_held(dice[d]): holds[d] = holds[d].format('held') f = Figlet(font='future_8') dies = f.renderText(' '.join(map(str,dice))) labels = (' ({}) ' + ' ')*len(dice) hint = get_choice(dice) score = score_dice(hint) clear() print rolled.format(labels.format(*range(1,len(dice)+1)),dies,holds,hint,score)
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()
def run(self, *args): """!ascii: Usage: !ascii (_FontName_) Your Text / !ascii ?Fonts Posts custom ascii text art into chat. ?Fonts will send you a list of fonts via pm. Use custom fonts like this: !ascii _starwars_ Woooo Ascii Art! ___""" font = 'slant' try: chatid = int(args[1][0]) except: print "FAILED" return 0 try: if args[0].upper() == "?FONTS": f = Figlet(font) fontlist = "Available fonts:\n" fontlist += formatList(f.getFonts()) self.parent.librewired.sendPrivateMsg(int(args[1][1]), fontlist) return 0 except: return "Usage: !ascii (%FontName%) Text / !ascii ?Fonts" param = regmatch(args[0], '_') if param: font = param text = regexclude(args[0], '_') if not text: return 0 else: text = args[0] if not len(text): return "Usage: !ascii (%FontName%) Text / !ascii ?Fonts" asciitext = 0 try: f = Figlet(font) asciitext = f.renderText(text) except FontNotFound: return "Unknown font: " + str(font) if asciitext: lines = asciitext.split('\n') sswired = chr(31).join(lines) for aline in lines: if len(aline.strip()): self.parent.librewired.sendChat(chatid, chr(14) + aline) self.parent.librewired.sendChat(chatid, chr(129) + sswired) return 0
def network_2(): f = Figlet(font='slant') shutil.copyfile("../data/c18493dcc4281aef5d3c4b24d674d8e3-net02.pcap", "c18493dcc4281aef5d3c4b24d674d8e3-net02.pcap") shutil.copyfile("../data/diskimage.gz", "diskimage.gz") print(f.renderText("Notwork Forensics")) wrap_input("""Network Forensics 2 - Notwork Forensics""") wrap_input("""First open the .pcap file in Wireshark and extract diskimage.gz. I'll wait here.""") wrap_input("""Ready? OK. First gunzip the file.""") wrap_shell_command(["gunzip", "diskimage.gz"]) wrap_input("""Now use mmls to look at the partition table.""") wrap_shell_command(["mmls", "diskimage"]) wrap_input("""So we've got an NTFS partition at sector 128. Try to see what we can recover from this.""") wrap_shell_command(["tsk_recover", "-e", "-o 128", "diskimage", "."]) wrap_shell_command(["ls", "-lha"]) wrap_input("""You can learn a lot from what people throw away.""") wrap_shell_command(["ls", "-Ra", "$RECYCLE.BIN"]) wrap_input("""Sure enough:""") wrap_shell_command(["cat", "$RECYCLE.BIN/S-1-5-21-2229788878-2747424913-2242611199-1000/$ISH2ZGB.txt"]) print() wrap_input("""That file looks interesting, but it's not in the files directory:""") wrap_shell_command(["ls", "-a", "./files/My Secret Passwords.txt"]) wrap_input("""There are a bunch of interesting files called secret* though:""") wrap_shell_command(["ls ./files/secret*"], shell=True) wrap_input("""secret.db is junk and secret.png is a red herring:""") wrap_shell_command(["eog", "files/secret.png"]) wrap_input("""secret.7z is encrypted:""") wrap_shell_command(["7z", "x", "files/secret.7z"]) wrap_input("""There hints about NTFS storing small and large files differently in the root directory.""") wrap_shell_command(["grep -C 5 \"small value\" NTFS\ -\ SleuthKitWiki.htm"], shell=True) wrap_input("""Apparently small files are stored directly in the MFT. We know the partition offset (128) from before, so use icat to extract it:""") wrap_shell_command(["icat -o 128 diskimage 0 > mft.dat"], shell=True) wrap_input("""Now look for interesting strings:""") wrap_shell_command(["strings mft.dat --bytes 6 | tail"], shell=True) wrap_input("""That looks a lot like a list of passwords. Try the one labelled \"7z file\":""") wrap_shell_command(["7z x -y ./files/secret.7z -p'nRkmrtp2(\"u8~/ph'"], shell=True) wrap_shell_command(["cat", "secret.txt"]) print() wrap_input("""And we're done!""")
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()
def stopwatch(stdscr, font=DEFAULT_FONT, quit_after=None, **kwargs): curses_setup() f = Figlet(font=font) sync_start = datetime.now() seconds_elapsed = 0 while quit_after is None or seconds_elapsed < int(quit_after): stdscr.erase() draw_text( stdscr, f.renderText(format_seconds(seconds_elapsed)), ) sleep_target = sync_start + timedelta(seconds=seconds_elapsed + 1) now = datetime.now() if sleep_target > now: sleep((sleep_target - now).total_seconds()) seconds_elapsed = int((datetime.now() - sync_start).total_seconds())
def main(): tool = FBTools() f = Figlet(font="slant") print(f.renderText("FBTools\n------")) if tool.loginChecker() == True: print("Attempting Login...") tool.cookieInjector() else: tool.login() if tool.loginChecker() == True: tool.greeting() tool.commandInput() else: sys.exit("Can't proceed.")
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__() }
def text(self, text, x, y, colour): sys.stderr.write("LCD:text %s %sx%s %s\n" % (text, x, y, colour)) font = 'clr8x8' figlet = Figlet(font=font, width=self._x) txt = figlet.renderText(text) dx = 0 dy = 0 for item in txt: if item == ' ': color = int(not bool(colour)) elif item == '#': color = colour elif item == '\n': dy += 1 dx = 0 continue self.pixel(dx + x, dy + y, color) dx += 1
def decorate( self, edit, currentSelection ): # Convert the input range to a string, this represents the original selection. original = self.view.substr( currentSelection ); # Construct a local path to the fonts directory. fontsDir = os.path.join(sublime.packages_path(), 'ASCII Decorator', 'pyfiglet', 'fonts') # Convert the input string to ASCII Art. settings = sublime.load_settings('ASCII Decorator.sublime-settings') f = Figlet( dir=fontsDir, font=settings.get('ascii_decorator_font') ) output = f.renderText( original ); # Normalize line endings based on settings. output = self.normalize_line_endings( output ) # Normalize whitespace based on settings. output = self.fix_whitespace( original, output, currentSelection ) self.view.replace( edit, currentSelection, output ) return sublime.Region( currentSelection.begin(), currentSelection.begin() + len(output) )
def banner(phenny, input): if len(input.group(2)) > 70: phenny.reply("pls... 2long4me") return bannedfonts = [ "acrobatic", "calgphy", "calgphy2", "doh", "poison", "univers", "term", "hollywood", "dotmatrix" ] inputArray = input.group(2).split(', ') if inputArray[0][0] == "": text = inputArray[0][2:] else: text = inputArray[0] if len(inputArray) > 1: if inputArray[1] in bannedfonts: phenny.say("ayy m80 %s is a banned font k?" % inputArray[1]) return try: f = Figlet(font=inputArray[1]) shit = f.renderText(text).split('\n') except: phenny.say("there's no font called %s" % inputArray[1]) return else: f = Figlet(font="twopoint") shit = f.renderText(text).split('\n') for i in xrange(0,len(shit)): if inputArray[0][0] == "": phenny.say("" + inputArray[0][1] + shit[i]) else: phenny.say(shit[i])
#!/usr/bin/env python from termcolor import colored from pyfiglet import Figlet import requests import optparse import urlparse import re import os dir_location = os.getcwd() custom_fig = Figlet(font='avatar') print(colored(custom_fig.renderText('Explorer'), "red", attrs=['bold'])) print( colored('Explorer - Web Crawler\nCoded by Eslam Akl - @eslam3kl\n\n ', 'cyan', attrs=['bold'])) print(colored("[+] Explorer's Mode list:", 'red', attrs=['bold'])) print( colored( '{+} Discover subdomains --> 1\n{+} Discover the Hidden & Public directories --> 2\n{+} Collect the links from the source code page --> 3\n{+} Perform all Tasks on the given domain --> 4\n', 'yellow', attrs=['bold'])) #Get the target URL from the user def get_user_input(): parser = optparse.OptionParser() parser.add_option("-u",
before_step(context, step), after_step(context, step) These run before and after every step. The step passed in is an instance of Step. before_feature(context, feature), after_feature(context, feature) These run before and after each feature file is exercised. The feature passed in is an instance of Feature. before_all(context), after_all(context) These run before and after the whole shooting match. ''' import subprocess from pyfiglet import Figlet from pyshould import should from clint.textui import puts, colored, indent f = Figlet(font='starwars', width=100) def before_feature(_context, _feature): ''' before_feature(context, feature), after_feature(context, feature) These run before and after each feature is run. ''' print(colored.red(f.renderText('Jenkins Operator'))) print( colored.yellow( "\nChecking cluster environment for {} scenario".format(_feature))) def before_scenario(_context, _scenario): '''
def friendship(livequeue=None): def mkdir(path): folder = os.path.exists(path) if folder == False: os.makedirs(path) else: path = path + "_" + "1" while os.path.exists(path) == True: path = path[0:-1] + str(int(path[-1]) + 1) os.makedirs(path) return path print( """=============================友谊赛================================""") f = Figlet() print(f.renderText(" 2 0 4 8 Final")) ####Friendship#### print( """================================================================""") s = input("Please input F to start match all final : ") while s != "F": if s == "Break": sys.exit(0) s = input("Please input F to start match all final : ") finalplayerlist = [NwinnerN19, FwinnerF19] path = mkdir('all final') winnerfinal = runner.main( finalplayerlist, path + "/" + " " + inf.information[NwinnerN19[11:-3]] + " " + "vs" + " " + inf.information[FwinnerF19[11:-3]], live.queues[2], True, True, True, False, c.REPEAT, c.MAXTIME, c.ROUNDS)[3] #print(winnerfinal) f = open(path + '/' + "all final.txt", 'w') f.write("all final winners:" + "\n") f.write(inf.information[winnerfinal[11:-3]]) f.close() s = input("是否显示出线小组详细信息 (Y or N) : ") f = Figlet() print( """================================================================""") print(f.renderText("Congratulations")) print("""=========================N19 友谊赛结果===========================""") while s != "N": if s == "Y": print( " 恭喜以下小组同学获得本次对抗2048比赛总冠军! ") print(" " + inf.information[winnerfinal[11:-3]] + " ") break else: s = input("是否显示总冠军小组详细信息 (Y or N,输入N进入颁奖) : ") print( """==================================================================""" ) ###比赛冠亚季军汇报### s = input("是否输入命令汇报比赛冠亚季军结果 (Y or N) : ") print( """=============================颁奖汇报==============================""") while s != "N": if s == "Y": f = Figlet() print( """==================================================================""" ) print(f.renderText("Congratulations")) print( """===============================F19组冠亚季军===========================""" ) print(" 恭喜以下小组同学获得本次对抗2048比赛冠亚季军! ") print( " F19组季军: " ) print(" " + thirdsF191 + " ") print(" " + thirdsF192) print( " F19组亚军: " ) print(" " + secondF19) print( " F19组冠军: " ) print(" " + inf.information[FwinnerF19[11:-3]]) print( """===========================N19组冠亚季军============================""" ) print( " N19组季军: " ) print(" " + thirdN19) print( " N19组亚军: " ) print(" " + secondN19) print( " N19组冠军: " ) print(" " + inf.information[NwinnerN19[11:-3]]) print( """=============================友谊赛总冠军=============================""" ) print( " 友谊赛总冠军: " ) print(" " + inf.information[winnerfinal[11:-3]]) print( """=====================================================================""" ) f = Figlet() print( f.renderText(" 2048 ")) print( """======================================================================""" ) break else: s = input("是否输入 Report 命令开始汇报比赛冠亚季军结果 (Y or N,输入N结束比赛) : ") f = Figlet() print(f.renderText(" END ")) print( """==============================================================================""" )
import argparse import os import sys import subprocess from pyfiglet import Figlet def validatePath(path): if ((not os.path.isdir(path)) and (not os.path.isfile(path))): print('The path or file ' + path + ' specified does not exist') sys.exit() # Print name of the APP title = Figlet(font='slant') subtitle = Figlet(font='bubble') print(title.renderText('CodeVQL')) print(subtitle.renderText('Version-Aware Security Analysis')) # Create the parser runner = argparse.ArgumentParser(description='\ This is the Command Line Interface(CLI) of the CodeVQL language. \ CodeVQL can perform the basic security analysis in a version-aware way. \ For more information, please check at this link [TODO]. \ ') # Add the arguments runner.add_argument('--repo_path', type=str, help='the path to the program to be analyzed upon') runner.add_argument('--gitfacts_path', type=str, help='the path to the tool that generates git facts, install here(https://github.com/uxhg/ext-gitfacts)')
else: Figlt.fig() display() Invld.invalid() pass c = "y" while True: if c == "y" or c == "Y": tic_tac_toe() elif c == 'n' or c == "N": break else: Figlt.fig() Invld.invalid() print() c = input('Play Again (y/n) ?:') Clr.clear() if c == 'n' or c == 'N': f = Figlet(font='bubble') print('\033[36m') print(f.renderText('TIC TAC TOE')) print('\033[37m') print() print('\033[36m') print(f.renderText(' THANK YOU')) print('\033[37m') time.sleep(2) Clr.clear() print()
def main(): parser = argparse.ArgumentParser () # use docs to check which parameters are required for specific board, e.g. for Cyton - set serial port parser.add_argument ('--timeout', type = int, help = 'timeout for device discovery or connection', required = False, default = 0) parser.add_argument ('--ip-port', type = int, help = 'ip port', required = False, default = 0) parser.add_argument ('--ip-protocol', type = int, help = 'ip protocol, check IpProtocolType enum', required = False, default = 0) parser.add_argument ('--ip-address', type = str, help = 'ip address', required = False, default = '') parser.add_argument ('--serial-port', type = str, help = 'serial port', required = False, default = '') parser.add_argument ('--mac-address', type = str, help = 'mac address', required = False, default = '') parser.add_argument ('--other-info', type = str, help = 'other info', required = False, default = '') parser.add_argument ('--streamer-params', type = str, help = 'streamer params', required = False, default = '') parser.add_argument ('--serial-number', type = str, help = 'serial number', required = False, default = '') parser.add_argument ('--board-id', type = int, help = 'board id, check docs to get a list of supported boards', required = True) parser.add_argument ('--log', action = 'store_true') args = parser.parse_args () params = BrainFlowInputParams () params.ip_port = args.ip_port params.serial_port = args.serial_port params.mac_address = args.mac_address params.other_info = args.other_info params.serial_number = args.serial_number params.ip_address = args.ip_address params.ip_protocol = args.ip_protocol params.timeout = args.timeout if (args.log): BoardShim.enable_dev_board_logger () else: BoardShim.disable_board_logger () board = BoardShim (args.board_id, params) board.prepare_session () board.start_stream (45000, args.streamer_params) model = P300ClassifierLDA() model.load("test-model") figlet = Figlet(font='slant') stopped = True raw = None time.sleep(3) while stopped: try: with mne.utils.use_log_level('error'): # time.sleep(MICROSECONDS_BEFORE_STIMULUS / 1000) # show_stimulus() # time.sleep(MICROSECONDS_AFTER_STIMULUS / 1000) data = board.get_current_board_data(SAMPLES_TOTAL) # TODO constant from model raw = create_raw(data, model) prediction = prepare_raw(raw, model) print_prediction(figlet, prediction) except KeyboardInterrupt: print("Got keyboard interrupt, stopping...") break board.stop_stream () board.release_session ()
def display(msg,style): f = Figlet(font=style) print('\n'*10) print(f.renderText(msg))
startTime = time.time() import ipaddress import os.path import random from pyfiglet import Figlet from colorama import Fore from scapy.all import * red = Fore.RED green = Fore.GREEN yel = Fore.YELLOW reset = Fore.RESET print(reset) logo = Figlet(font='graffiti') print(green + logo.renderText('\n%R##########Remoterz.net#########%R' + reset)) conf = configparser.ConfigParser() def config(): global all_ip global ports global countip global countport global startTime startTime = time.time() if os.path.exists('config.cfg'): print('##config.cfg is exist##') else: conf.add_section('hosts')
Fore.GREEN + Style.BRIGHT + ">> [+] Successfully Initiated A Connection To Google's SMTP Servers" ) time.sleep(1) smtpserver.ehlo() smtpserver.starttls() smtpserver.login(user_email, user_password) time.sleep(2) print(Fore.GREEN + Style.BRIGHT + ">> [+] Successfully Logged in as " + str(user_email)) time.sleep(1) target_email = input(Fore.CYAN + Style.BRIGHT + ">> [?] Enter Target Email: ") time.sleep(1) msg = input(Fore.CYAN + Style.BRIGHT + ">> [*] Enter Message To Spam: ") while True: smtpserver.sendmail(user_email, target_email, msg) print(Fore.GREEN + Style.BRIGHT + ">> [+] Email Sent") except Exception as e: print(Fore.RED + Style.BRIGHT + "Problem Encountered: " + str(e)) time.sleep(1) sys.exit() custom_fig = Figlet(font='avatar') print(Fore.CYAN + Style.BRIGHT + custom_fig.renderText('Evil Mailer')) a = threading.Thread(target=send_mail()) a.start()
if(anstoboot == "start" or anstoboot == " start" or anstoboot == "Start" or anstoboot == " Start"): persontypedno = False while True: ryoutired = input("Type yes and press enter if you're about to fall asleep ") if(ryoutired == "yes" or ryoutired == "Yes"): print("Opening browser...") webbrowser.open ("https://www.youtube.com/watch?v=s20Pn-eS3VA", new=1, autoraise=True) if(anstoboot == "Dragonboi"): #easteregg f = Figlet(font='larry3d') print(f.renderText('AnonCodingDragon')) time.sleep(5) anstobootee = input("Congrats, you found this random easter egg! Type start and press enter to start the program: ") if(anstobootee == "start" or anstobootee == " start" or anstobootee == "Start" or anstobootee == " Start"): persontypedno = False while True: ryoutired = input("Type yes and press enter if you're about to fall asleep ") if(ryoutired == "yes" or ryoutired == "Yes"): print("Opening browser...") webbrowser.open ("https://www.youtube.com/watch?v=s20Pn-eS3VA", new=1, autoraise=True)
from subprocess import check_output from FloorplanToBlenderLib import * # floorplan to blender lib import os from pyfiglet import Figlet f = Figlet(font='slant') print(f.renderText('Floorplan to Blender3d')) ''' Create Blender Project from floorplan This file contains a simple example implementation of creations of 3d models from floorplans. You will need blender and an image of a floorplan to make this work. FloorplanToBlender3d Copyright (C) 2019 Daniel Westberg ''' if __name__ == "__main__": # Set required default paths image_path = "" # path the your image blender_install_path = "" # path to blender installation folder image_path, blender_install_path, file_structure, mode = IO.config_get_default( ) # Set other paths (don't need to change these) program_path = os.path.dirname(os.path.realpath(__file__)) blender_script_path = "Blender/floorplan_to_3dObject_in_blender.py" # Create some gui print("----- CREATE BLENDER PROJECT FROM FLOORPLAN WITH DIALOG -----") print( "Welcome to this program. Please answer the questions below to progress."
PY2 = sys.version < '3' WINDOWS = os.name == 'nt' EOL = '\r\n' if WINDOWS and not PY2 else '\n' from .. import * # load top level __init__ from ..VERSION import VERSION from ..core import ONTOSPY_LOCAL from ..core import manager from ..core import actions from ..core.ontospy import Ontospy from ..core.utils import * from .shell_quotes import * # quotes f = Figlet(font='slant') _intro_ = """*** The Command Line Ontology Browser (%s) *** """ STARTUP_MESSAGE = f.renderText( 'Ontospy') + Style.BRIGHT + _intro_ % VERSION + Style.RESET_ALL def _get_prompt(onto="", entity=""): """ Global util that changes the prompt contextually :return: [Ontospy]>(cidoc_crm_v5.0...)>(class:E1.CRM_Entity)> """ base_text, onto_text, entity_text = "", "", "" base_color, onto_color, entity_color = Fore.RED + Style.BRIGHT, Fore.BLACK + Style.DIM, Fore.BLACK
def show_header(): fig = Figlet(font='slant') print(fig.renderText('crypto-bot'))
def print_header(): f = Figlet(font='slant') print(f.renderText('JANET')) print_cmd()
#map of letters to indicies numbers = { 'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9 } letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'] figlet = Figlet('rectangles', width=150) # clear the terminal window #https://stackoverflow.com/questions/2084508/clear-terminal-in-python def clear(): os.system('cls' if os.name == 'nt' else 'clear') def wrap_in_box(text, width=None): lines = text.split('\n') if (width is None): width = max(map(lambda line: len(line), lines)) newLines = list() newLines.append('╔' + ('═' * width) + '╗') for line in lines:
class AmitySpaceAllocation(cmd.Cmd): f = Figlet(font='slant') dojo = Amity() # Makes the interface look better print(Fore.GREEN + f.renderText('Amity Space Allocation ')).center(10) print(Fore.YELLOW + ('Type help to get a list of commands')).center(70) print(Fore.YELLOW + ('Type a command to get the arguments it requires')).center(70) prompt = '(amity) ' file = None @docopt_cmd def do_create_room(self, arg): """Usage: create_room <room_type> <room_name>...""" try: room_type = str(arg['<room_type>']) room_list = arg['<room_name>'] if len(room_list) == 1: self.dojo.create_room({ "room_type": room_type, "room_name": str(room_list[0]) }) else: self.dojo.create_room({ "room_type": room_type, "room_name": room_list }) except TypeError: print(colored("The Values shoud be strings")) @docopt_cmd def do_add_person(self, arg): """Usage: add_person <fname> <lname> <role> [<accomodation>] """ try: first_name = str(arg['<fname>']) last_name = str(arg['<lname>']) role = str(arg['<role>']) accomodation = arg['<accomodation>'] except TypeError: print("You have to pass names") if accomodation == None: wants_accomodation = 'N' else: wants_accomodation = accomodation self.dojo.create_person(first_name, last_name, role, wants_accomodation) @docopt_cmd def do_load_people(self, arg): """Usage: load_people <file_name> """ file_name = arg['<file_name>'] file_name = file_name + ".txt" self.dojo.load_people(file_name) @docopt_cmd def do_print_allocations(self, arg): """Usage: print_allocations [<file_name>] """ file_name = arg['<file_name>'] if file_name: file_name = file_name + ".txt" self.dojo.print_allocations(file_name) else: self.dojo.print_allocations() @docopt_cmd def do_print_unallocated(self, arg): """Usage: print_unallocated [<file_name>] """ file_name = arg['<file_name>'] if file_name: file_name = file_name + ".txt" self.dojo.print_unallocated(file_name) else: self.dojo.print_unallocated() @docopt_cmd def do_print_room(self, arg): """Usage: print_room <room_name> """ room_name = arg['<room_name>'] self.dojo.print_room(room_name) @docopt_cmd def do_save_state(self, arg): """Usage: save_state [<database_name>]""" db_name = arg['<database_name>'] if db_name: self.dojo.save_state(db_name) else: self.dojo.save_state('amity') @docopt_cmd def do_load_state(self, arg): """Usage: load_state <database_name> """ db_name = str(arg['<database_name>']) self.dojo.load_state(db_name) @docopt_cmd def do_reallocate(self, arg): """Usage: reallocate <id> <room_to> """ id = arg['<id>'] room_to = arg["<room_to>"] self.dojo.reallocate(id, room_to) def do_quit(self, arg): """Quits out of Interactive Mode.""" exit()
def fontconvert(strfont): font = strfont f = Figlet(font='stop') print(colored(f.renderText(font), 'green', attrs=['bold']))
import sys import os from pyfiglet import Figlet from selenium import webdriver import time from colorama import init from termcolor import cprint from pyfiglet import figlet_format #make a temp URL and browser reference url = "http://www.cnn.com/" #choose some fonts f = Figlet(font='big') a = Figlet(font='xhelvi') #dont look at this garbage # script = ''' # alert('hihihih') # ''' # driver.execute_script(script, yo); # print 'EXECUTED!' # driver.execute_script(script); #start the console conversation os.system("say hi! What is your name?") question = "What is your name? " print f.renderText(question) theirName = raw_input("-------------->") #store their answer in a variable
from scipy.linalg import subspace_angles import math from tqdm import tqdm import torch from pyfiglet import Figlet os.system('clear') import warnings warnings.filterwarnings("ignore", category=FutureWarning) print( "===============================================================================================" ) f = Figlet(font='thin') print(f.renderText('Invariance Baseline')) print(":::: Code by Adepu Ravi Shankar & Rahul-Vigneswaran K 2019 ::::") print( "===============================================================================================\n" ) # Initialize Variables prev_hess = 0 prev_eigval = 0 prev_eigvec = 0 initial_model = [] parser = argparse.ArgumentParser() # Hessian
import sys from PyInquirer import style_from_dict, Token, prompt from PyInquirer import Validator, ValidationError from hotel.models import Room from pyfiglet import Figlet f = Figlet(font='slant') style = style_from_dict({ Token.QuestionMark: '#E91E63 bold', Token.Selected: '#673AB7 bold', Token.Instruction: '', # default Token.Answer: '#2196f3 bold', Token.Question: '', }) class NumberValidator(Validator): def validate(self, document): try: int(document.text) except ValueError: raise ValidationError(message='Please enter a number', cursor_position=len( document.text)) # Move cursor to end questions = [{ 'type': 'input', 'name': 'budget', 'message': 'Provide your budget in USD to get rooms',
last_name = self.author.split(' ')[1][0] print( f"\nWrong again! Last hint: \n\nAuthor's last name starts with: {last_name}\n" ) self.num_guess -= 1 self._guess() else: print(f"\nWrong! You lost. The author was {self.author}\n\n") def _quote_true(self, guess): if guess.lower() == self.author.lower(): return True return False f = Figlet(font='big') text = "QUOTE GUESSR" color = "magenta" print(colored(f.renderText(text), color="magenta")) print("Welcome to the quote guessing game\n") game = Game() again = 'kattenplaatjes' while again: game.play_game() while again.lower() not in ('y', 'yes', 'no', 'n'): again = input("Want to play again (y/n)? ") if again.lower() in ('n', 'no'): break print("\nHere's another game! \n")
def display_menu(turntable, lock): global global_t # timer 1 for display updates global global_start_time global global_start_pos UIstring = ("O return to Origin (zero)\n" "S Stop motor\n" "W sWeep 180 deg\n" "E swEep preparation (go to -90 deg)\n" "R rotate Right\n" "L rotate Left\n" "{} advance right {} deg\n" "{} advance left {} deg\n" "] advance right {} deg\n" "[ advance left {} deg\n" "Z reset origin (Zero) to current position\n" "P go to Position\n" "N iNcrement by (+/-)aNgle\n" "G Go to (+/-)anGle (ref Origin)\n" "I display system Info\n" "C system Configuration\n\n" "1 Speed low ({} sec/rot)\n" "2 Speed medium ({} sec/rot)\n" "3 Speed high ({} sec/rot)\n\n" "Q Quit\n\n>".\ format(u'\u2192',NUDGE_DEG, u'\u2190',NUDGE_DEG, SMALL_NUDGE_DEG, SMALL_NUDGE_DEG, MOT_LOW_SPEED,MOT_MED_SPEED,MOT_HIGH_SPEED)) # if we are moving to start sweepstart location then just let it happen, or clear flag if we are there already if turntable.sweep_preparation: if int(turntable_command(turntable,lock).get_angle()) == -90: turntable.sweep_preparation = False turntable_command(turntable,lock).restore_rot_rate_vals() global_t = threading.Timer( 1, display_menu, args=[ turntable, lock, ]) global_t.start() if not __debug__: pos = turntable_command(turntable,lock).get_pos() else: pos = 0 delta_pos = pos - global_start_pos # change in mstp since last time current_time = get_current_millis() delta_time = ( current_time - global_start_time) / 1000 # duration since update in seconds try: degrees = delta_pos / turntable.mstp_per_deg current_speed = delta_time / ( delta_pos / turntable.mstp_per_deg) * 360 / turntable.motor_ratio # current speed in sec/rot since we started moving except ZeroDivisionError: current_speed = 0 if this_platform == "Windows": os.system("cls") pass else: print("\n\033[H\033[J", end='') try: degmin = 60*360/(current_speed * turntable.motor_ratio ) except ZeroDivisionError: degmin = 0.0 angle = turntable_command(turntable,lock).get_angle() angle = 90 if ANSI_COMPAT: #custom_fig = Figlet(width=200,font='Electronic') custom_fig = Figlet(width=200,font='LCD') ascii_text = custom_fig.renderText("{:.1f}".format(angle) + "\'") print( ("CSIRO B&K / Trinamic Turntable Control Software\n\n", "\033[3;37;44mCSIRO B&K / Trinamic Turntable Control Software\033[0;37;40m\n\n")[ANSI_COMPAT]+ ("",ascii_text)[ANSI_COMPAT] + "Current Angle: {:.2f} degrees (ref Origin) \n" "Target Speed: {:.2f} sec/rev ({:.2f} rpm, {:.2f} rph, {:.2f} deg/min, {:.2f} deg/s)\n" "Current Speed: {:.2f} sec/rev {:.3f} deg/min\n" #"Position: {}\n" #"Velocity: {} (int) Velocity Divisor: {}\n" #"Ratio: {} Microstep/deg: {:d}\n" "Positive direction (from above):". #format(pos / turntable.mstp_per_deg, format(angle, # sec/rev rpm rph deg/min deg/s 60 / turntable.mot_rpm(), turntable.mot_rpm(), turntable.mot_rpm()*60, turntable.mot_rpm()*360, turntable.mot_rpm()*360/60, current_speed * turntable.motor_ratio, degmin) + #pos, #turntable.motor_velocity, turntable.motor_vel_div, #turntable.motor_ratio, int(turntable.mstp_per_deg)) + (' Clockwise, Left', ' Counterclockwise, Right')[turntable.motor_dir > 0] + ('\n', '\033[1;32;40m Remote Sweep Activated - (S)top and reset \033[0;37;40m\n')[turntable.remote_sweeping] + ('\n', '\033[1;31;40m Moving to sweep start position, please wait... (S)top rotation or (Q)uit program.\033[0;37;40m\n')[turntable.sweep_preparation] + UIstring,end='')
#init program global variables ################################################################## phrase = '' maxBackgroundStartVolume = args.maxBackgroundStartVolume maxBackgroundStartCrossings = args.maxBackgroundStartCrossings seconds = args.seconds jsonFile = args.jsonFile #frames = [] numActualRecordedFrames = 0 maxFramesBeforeTrim = int(RATE / CHUNK * seconds) #textToSpeech = talkey.Talkey() textToSpeech = talkey.Talkey(preferred_language=['en']) p = pyaudio.PyAudio() # Create an interface to PortAudio f = Figlet() phrasesArray = [] quitProgram = False newPhraseAddedThisTime = False ################################################################## def listPhrasesTrained(): listedPhrases = [] for phrase in phrasesArray: print(phrase.keys()) if not phrase['phrase'] in listedPhrases: listedPhrases.append(phrase['phrase'])
def banner(): banner_ = Figlet(font='slant') print(banner_.renderText('Peppa-GitScan')) print("<---------WELCOME TO USE THIS PROGRAM--------->") print("<---------v1.0 - Author - nJcx86--------->") print("\n")
def app_title(): figlet = Figlet(font='slant', width=150) print(figlet.renderText("Password Organizer")) print('\n')
import sys import os from time import sleep from datetime import datetime, date, time, timedelta from pyfiglet import Figlet if len(sys.argv) < 3 or sys.argv[1] == "-h" or sys.argv[1] == "--help": print("Reads the file given as the first argument and lists the next [second argument] events coming up") print("NOTE: The events must be in time order.") exit() while True: output = "" now = datetime.now() f = Figlet(font="assets/shefjam.flf", width=100) output += f.renderText("Upcoming Events") #print("\nUpcoming Events:\n") events = [] with open(sys.argv[1], "r") as f: events = f.readlines(); if len(events) < 1: continue # Get the size of the pane rows, columns = os.popen('stty size', 'r').read().split() eventsShown = 0 eventsMax = int(sys.argv[2]) for i in xrange(len(events)):
f'dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\{to_download_line[1]}"' ) print(f'1 / {q}') try: while l < q: l += 1 os.system( f'dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\{to_download_line[l]}"' ) print(f'{l} / {q}') except IndexError: print("all the packages have been added") return True cf = Figlet(font="slant") c = cf.renderText("""WIN 10 Features Enabler""") print(c) print("the available options are below:") print("""1- "Docker" To install required features for Docker Desktop 2- Or enter the feature you want to enable e.g: containers """) user_input = str(input("Enter your desired option: ")) if user_input == "Docker": fetch("Hyper-V") download("Hyper-V") fetch("containers") download("containers") print("Now restart your PC") print(
def banner(self): f = Figlet(font='trek') name = f.renderText('Battleship') self.width = max(map(lambda line: len(line), name.split('\n'))) return wrap_in_box(name)
import tensorflow as tf from pyfiglet import Figlet from tqdm import tqdm import _pickle as pickle os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' click.echo("") click.echo("") click.echo("") click.echo("") click.echo("") click.echo("") click.echo("") f = Figlet(font='slant') click.echo(f.renderText('WIRED! Image CLI')) click.echo( 'Wired! Image CLI Is A Command Line Interface for Image Analysis. This CLI allows users to develop image categorization and object detection interfaces from a folder of images. It was developed throught the Wired! Lab at Duke University {}' .format(emoji.emojize(':zap:', use_aliases=True))) click.echo("") click.echo("") click.echo("") click.echo("") # dimensions of our images. img_width, img_height = 224, 224 top_model_weights_path = 'bottleneck_fc_model.h5'
"* ADDRESS, BYTE, AMOUNT, START, & LENGTH must be an integer\n\n" "write ADDRESS BYTE - write byte from memory\n" + "read ADDRESS - read byte from memory\n" + "randwrite AMOUNT - write random byte to random location in memory AMOUNT times\n" + "randread AMOUNT - read byte from random location in memory AMOUNT times\n" + "printcache START LENGTH - print LENGTH lines of cache from START\n" + "printmem START LENGTH - print LENGTH blocks of memory from START\n" + "stats - print out hits, misses, and hit/miss ratio\n" + "help - prints this message\n" + "quit - quit the simulator\n") if __name__ == '__main__': custom_fig = Figlet(font='slant') print(custom_fig.renderText('cpu cache simulator')) print( "This is a simulator for a CPU cache that I wrote for CSC 218 Computer Organization.\n" + "It's meant to demonstrate some of the different replacement, write, \n" + "and mapping policies that CPUs can implement.\n") memory_size = 0 cache_size = 0 block_size = 0 mapping_policy = 0 replacement_policy = "" write_policy = ""