Python colorama.Fore.WHITE Examples

The following are 30 code examples of colorama.Fore.WHITE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module colorama.Fore , or try the search function .
Example #1
Source File: rpsgame.py    From python-for-absolute-beginners-course with MIT License 6 votes vote down vote up
def get_roll(player_name, roll_names):
    try:
        print("Available rolls:")
        for index, r in enumerate(roll_names, start=1):
            print(f"{index}. {r}")

        text = input(f"{player_name}, what is your roll? ")
        if text is None or not text.strip():
            print("You must enter response")
            return None

        selected_index = int(text) - 1

        if selected_index < 0 or selected_index >= len(roll_names):
            print(f"Sorry {player_name}, {text} is out of bounds!")
            return None

        return roll_names[selected_index]
    except ValueError as ve:
        print(Fore.RED + f"Could not convert to integer: {ve}" + Fore.WHITE)
        return None 
Example #2
Source File: simpleStream.py    From alpaca-trade-api-python with Apache License 2.0 6 votes vote down vote up
def on_minute(conn, channel, bar):
    symbol = bar.symbol
    close = bar.close

    try:
        percent = (close - bar.dailyopen)/close  * 100
        up = 1 if bar.open > bar.dailyopen else -1
    except:  # noqa
        percent = 0
        up = 0

    if up > 0:
        bar_color = f'{Style.BRIGHT}{Fore.CYAN}'
    elif up < 0:
        bar_color = f'{Style.BRIGHT}{Fore.RED}'
    else:
        bar_color = f'{Style.BRIGHT}{Fore.WHITE}'

    print(f'{channel:<6s} {ms2date(bar.end)}  {bar.symbol:<10s} '
          f'{percent:>8.2f}% {bar.open:>8.2f} {bar.close:>8.2f} '
          f' {bar.volume:<10d}'
          f'  {(Fore.GREEN+"above VWAP") if close > bar.vwap else (Fore.RED+"below VWAP")}') 
Example #3
Source File: asm.py    From AttackSurfaceMapper with GNU General Public License v3.0 6 votes vote down vote up
def cprint(type, msg, reset):
    colorama.init()
    message = {
        "action": Fore.YELLOW,
        "positive": Fore.GREEN + Style.BRIGHT,
        "info": Fore.YELLOW,
        "reset": Style.RESET_ALL,
        "red": Fore.RED,
        "white": Fore.WHITE,
        "green": Fore.GREEN,
        "yellow": Fore.YELLOW
    }
    style = message.get(type.lower())

    if type == "error":
        print("{0}\n[*] Error: {1}".format(Fore.RED + Style.BRIGHT, Style.RESET_ALL + Fore.WHITE + msg))
    else:
        print(style + msg, end="")
    if reset == 1:
        print(Style.RESET_ALL)


# Print Results Function - 
Example #4
Source File: collapsar.py    From Collapsar with MIT License 6 votes vote down vote up
def atk(): #Socks Sent Requests
	ua = random.choice(useragent)
	request = "GET " + uu + "?=" + str(random.randint(1,100)) + " HTTP/1.1\r\nHost: " + url + "\r\nUser-Agent: "+ua+"\r\nAccept: */*\r\nAccept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nContent-Length: 0\r\nConnection: Keep-Alive\r\n\r\n" #Code By GogoZin
	proxy = random.choice(lsts).strip().split(":")
	socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, str(proxy[0]), int(proxy[1]))
	time.sleep(5)
	while True:
		try:
			s = socks.socksocket()
			s.connect((str(url), int(port)))
			if str(port) =='443':
				s = ssl.wrap_socket(s)
			s.send(str.encode(request))
			print(Fore.CYAN + "ChallengeCollapsar From ~[" + Fore.WHITE + str(proxy[0])+":"+str(proxy[1])+ Fore.CYAN + "]") #Code By GogoZin
			try:
				for y in range(per):
					s.send(str.encode(request))
				print(Fore.CYAN + "ChallengeCollapsar From ~[" + Fore.WHITE + str(proxy[0])+":"+str(proxy[1])+ Fore.CYAN + "]") #Code By GogoZin
			except:
				s.close()
		except:
			s.close() 
Example #5
Source File: cloudfail.py    From CloudFail with MIT License 6 votes vote down vote up
def crimeflare(target):
    print_out(Fore.CYAN + "Scanning crimeflare database...")

    with open("data/ipout", "r") as ins:
        crimeFoundArray = []
        for line in ins:
            lineExploded = line.split(" ")
            if lineExploded[1] == args.target:
                crimeFoundArray.append(lineExploded[2])
            else:
                continue
    if (len(crimeFoundArray) != 0):
        for foundIp in crimeFoundArray:
            print_out(Style.BRIGHT + Fore.WHITE + "[FOUND:IP] " + Fore.GREEN + "" + foundIp.strip())
    else:
        print_out("Did not find anything.") 
Example #6
Source File: buckethunter.py    From AttackSurfaceMapper with GNU General Public License v3.0 6 votes vote down vote up
def cprint(type, msg, reset):
    colorama.init()
    message = {
        "action": Fore.YELLOW,
        "positive": Fore.GREEN + Style.BRIGHT,
        "info": Fore.YELLOW,
        "reset": Style.RESET_ALL,
        "red": Fore.RED,
        "white": Fore.WHITE,
        "green": Fore.GREEN,
        "yellow": Fore.YELLOW
    }
    style = message.get(type.lower())

    if type == "error":
        print("{0}\n[*] Error: {1}".format(Fore.RED + Style.BRIGHT, Style.RESET_ALL + Fore.WHITE + msg))
    else:
        print(style + msg, end="")
    if (reset == 1):
        print(Style.RESET_ALL) 
Example #7
Source File: automate_project.py    From project-automation with MIT License 6 votes vote down vote up
def CreateGitHubRepo():
    global repoName
    global private
    global username
    global password
    GetCredentials()
    try:
        user = Github(username, password).get_user()
        user.create_repo(repoName, private=private)
        return True
    except Exception as e:
        repoName = ""
        username = ""
        password = ""
        private = ""
        print(Fore.RED + str(e) + Fore.WHITE)
        return False 
Example #8
Source File: automate_project.py    From project-automation with MIT License 6 votes vote down vote up
def GetCredentials():
    global repoName
    global private
    global username
    global password

    if repoName == "":
        repoName = input("Enter a name for the GitHub repository: ")
    if private == "":
        private = input("Private GitHub repository (y/n): ")
    while private != False and private != True:
        if private == "y":
            private = True
        elif private == "n":
            private = False
        else:
            print("{}Invalid value.{}".format(Fore.YELLOW, Fore.WHITE))
            private = input("Private GitHub repository (y/n): ")
    if username == "":
        username = input("Enter your GitHub username: ")
    if username == "" or password == "":
        password = getpass.getpass("Enter your GitHub password: ")


# creates GitHub repo if credentials are valid 
Example #9
Source File: text.py    From insights-core with Apache License 2.0 6 votes vote down vote up
def preprocess(self):
        response = namedtuple('response', 'color label intl title')
        self.responses = {
            'pass': response(color=Fore.GREEN, label="PASS", intl='P', title="Passed      : "),
            'rule': response(color=Fore.RED, label="FAIL", intl='F', title="Failed      : "),
            'info': response(color=Fore.WHITE, label="INFO", intl='I', title="Info        : "),
            'skip': response(color=Fore.BLUE, label="SKIP", intl='S', title="Missing Deps: "),
            'fingerprint': response(color=Fore.YELLOW, label="FINGERPRINT", intl='P',
                                  title="Fingerprint : "),
            'metadata': response(color=Fore.YELLOW, label="META", intl='M', title="Metadata    : "),
            'metadata_key': response(color=Fore.MAGENTA, label="META", intl='K', title="Metadata Key: "),
            'exception': response(color=Fore.RED, label="EXCEPT", intl='E', title="Exceptions  : ")
        }

        self.counts = {}
        for key in self.responses:
            self.counts[key] = 0

        self.print_header("Progress:", Fore.CYAN)
        self.broker.add_observer(self.progress_bar, rule)
        self.broker.add_observer(self.progress_bar, condition)
        self.broker.add_observer(self.progress_bar, incident)
        self.broker.add_observer(self.progress_bar, parser) 
Example #10
Source File: subbrute.py    From AttackSurfaceMapper with GNU General Public License v3.0 6 votes vote down vote up
def cprint(type, msg, reset):
    colorama.init()
    message = {
        "action": Fore.YELLOW,
        "positive": Fore.GREEN + Style.BRIGHT,
        "info": Fore.YELLOW,
        "reset": Style.RESET_ALL,
        "red": Fore.RED,
        "white": Fore.WHITE,
        "green": Fore.GREEN,
        "yellow": Fore.YELLOW
    }
    style = message.get(type.lower())


# A resolver wrapper around dnslib.py 
Example #11
Source File: cli.py    From Bast with MIT License 6 votes vote down vote up
def controller_creatr(filename):
    """Name of the controller file to be created"""

    path = os.path.abspath('.') + '/controller'
    if not os.path.exists(path):
        os.makedirs(path)

    # if os.path.isfile(path + )

    file_name = str(filename + '.py')
    if os.path.isfile(path + "/" + file_name):
        click.echo(Fore.WHITE + Back.RED + "ERROR: Controller file exists")
        return
    controller_file = open(os.path.abspath('.') + '/controller/' + file_name, 'w+')
    compose = "from bast import Controller\n\nclass " + filename + "(Controller):\n    pass"
    controller_file.write(compose)
    controller_file.close()
    click.echo(Fore.GREEN + "Controller " + filename + " created successfully") 
Example #12
Source File: subhunter.py    From AttackSurfaceMapper with GNU General Public License v3.0 6 votes vote down vote up
def cprint(type, msg, reset):
    colorama.init()
    message = {
        "action": Fore.YELLOW,
        "positive": Fore.GREEN + Style.BRIGHT,
        "info": Fore.YELLOW,
        "reset": Style.RESET_ALL,
        "red": Fore.RED,
        "white": Fore.WHITE,
        "green": Fore.GREEN,
        "yellow": Fore.YELLOW
    }
    style = message.get(type.lower())

    if type == "error":
        print("{0}\n[*] Error: {1}".format(Fore.RED + Style.BRIGHT, Style.RESET_ALL + Fore.WHITE + msg))
    else:
        print(style + msg, end="")
    if (reset == 1):
        print(Style.RESET_ALL) 
Example #13
Source File: logging_helpers.py    From dephell with MIT License 6 votes vote down vote up
def format(self, record):
        # add color
        if self.colors and record.levelname in COLORS:
            start = COLORS[record.levelname]
            record.levelname = start + record.levelname + Fore.RESET
            record.msg = Fore.WHITE + record.msg + Fore.RESET

        # add extras
        if self.extras:
            extras = merge_record_extra(record=record, target=dict(), reserved=RESERVED_ATTRS)
            record.extras = ', '.join('{}={}'.format(k, v) for k, v in extras.items())
            if record.extras:
                record.extras = Fore.MAGENTA + '({})'.format(record.extras) + Fore.RESET

        # hide traceback
        if not self.traceback:
            record.exc_text = None
            record.exc_info = None
            record.stack_info = None

        return super().format(record) 
Example #14
Source File: display.py    From Instagram with MIT License 6 votes vote down vote up
def stats_found(self, password, attempts, browsers):
        self.stats(password, attempts, browsers, load=False)

        if self.__is_color:
            print('\n{0}[{1}!{0}] {2}Password Found{3}'.format(
                Fore.YELLOW, Fore.RED, Fore.WHITE, Fore.RESET
            ))

            print('{0}[{1}+{0}] {2}Username: {1}{3}{4}'.format(
                Fore.YELLOW, Fore.GREEN, Fore.WHITE, self.username.title(), Fore.RESET
            ))

            print('{0}[{1}+{0}] {2}Password: {1}{3}{4}'.format(
                Fore.YELLOW, Fore.GREEN, Fore.WHITE, password, Fore.RESET
            ))
        else:
            print('\n[!] Password Found\n[+] Username: {}\n[+] Password: {}'.format(
                self.username.title(), password
            ))

        sleep(self.delay) 
Example #15
Source File: Th3Reverser.py    From Th3Reverser with GNU General Public License v3.0 5 votes vote down vote up
def listening_option():
  listening = input("[+] Do you want to start listening [Y/n]: ")
  if listening.lower() == "y":
    print("""                                                
        .-///:-`                           
    `/ymhso++oydms:                        
   +mh/`./+oo+:``+dd/                      
 `hm: /dds/:/+smh: +Ns                     
 hm.`hm/       `oNo /No      `o+           
.Ns +No`         sN- dm    `: :mh.         
`-` /sydds-      +N/ hN` ` /mh``dm.        
        .sNs    .md`.mh .my`.md`.mh        
          /N+  `dm.`dm.  -Ns /N+ sN.       
           Nh `hm- hm-    dm .Ns +N:       
          /N+ yN- yN:    -Ny /N+ sN.       
        .sNs sN: sN/    .my`.md`.mh        
     +ydds- oN/ oN+      ` /mh``dm.        
     .-`   -d+ +No         `: :mh.         
`/.           /Ns            `o+           
`mh          :Ny                           
 :mh-      `+Ny                            
  .omdso+oymy:                             
     .://:-`

[+] Listening for any connections:  
[!] NOTE: TYPE SOME COMMANDS AND WHEN A REVERSE SHELL CONNECTION IS ETABLISHED THEY WILL BE EXECUTED.
""")
    os.system("echo [!] nclib doesn't work on Windows [!] && exit" if platform.system() == "Windows" else "python3 -c 'import nclib; nclib.Netcat(listen=("+Port+")).interact();'")
    exit()
  elif listening.lower() == "n":
    print(Fore.WHITE+Back.RED+"[-] OK, GOOD-BYE [-]"+Style.RESET_ALL)
    exit()
  else:
    print(Fore.WHITE+Back.RED+"[!] Please enter a valid option [!]"+Style.RESET_ALL)
    listening_option() 
Example #16
Source File: display.py    From Instagram with MIT License 5 votes vote down vote up
def shutdown(self, password, attempts, browsers):
        self.stats(password, attempts, browsers, load=False)

        if self.__is_color:
            print('\n{0}[{1}!{0}] {2}Shutting Down ...{3}'.format(
                Fore.YELLOW, Fore.RED, Fore.WHITE, Fore.RESET
            ))
        else:
            print('\n[!] Shutting Down ...')

        sleep(self.delay) 
Example #17
Source File: 8080.py    From 8080py with GNU General Public License v3.0 5 votes vote down vote up
def printHelp():
    print('\nThis ' + Fore.BLUE + 'Intel' + Fore.WHITE
          + ' 8080 assembler was made for ' + Fore.BLUE + 'Project '
          + Fore.YELLOW + 'Week' + Fore.WHITE + ' at my school.')
    print('It is written in ' + Fore.BLUE + 'Pyt' + Fore.YELLOW + 'hon'
          + Fore.WHITE)
    print('Modules: ' + Fore.RED + 'Co' + Fore.BLUE + 'lo'
          + Fore.YELLOW + 'ra' + Fore.GREEN + 'ma' + Fore.WHITE)
    print('\nPass a file path as an arguement.')


# Main function 
Example #18
Source File: internal.py    From cheat.sh with MIT License 5 votes vote down vote up
def _back_color(code):
    if code == 0 or (isinstance(code, str) and code.lower() == "white"):
        return Back.WHITE
    if code == 1 or (isinstance(code, str) and code.lower() == "cyan"):
        return Back.CYAN
    if code == 2 or (isinstance(code, str) and code.lower() == "red"):
        return Back.RED

    return Back.WHITE 
Example #19
Source File: display.py    From Instagram with MIT License 5 votes vote down vote up
def stats_not_found(self, password, attempts, browsers):
        self.stats(password, attempts, browsers, load=False)

        if self.__is_color:
            print('\n{0}[{1}!{0}] {2}Password Not Found{3}'.format(
                Fore.YELLOW, Fore.RED, Fore.WHITE, Fore.RESET
            ))
        else:
            print('\n[!] Password Not Found')

        sleep(self.delay) 
Example #20
Source File: record.py    From checkov with Apache License 2.0 5 votes vote down vote up
def _code_line_string(code_block):
        string_block = ''
        last_line_number, _ = code_block[-1]

        for (line_num, line) in code_block:
            spaces = ' ' * (len(str(last_line_number)) - len(str(line_num)))
            if line.lstrip().startswith('#'):
                string_block += "\t\t" + Fore.WHITE + str(line_num) + spaces + ' | ' + line
            else:
                string_block += "\t\t" + Fore.WHITE + str(line_num) + spaces + ' | ' + Fore.YELLOW + line
        return string_block 
Example #21
Source File: aesthetics.py    From BrundleFuzz with MIT License 5 votes vote down vote up
def m_fatal(self, m):
        m = '[X] ' + m
        if COLORAMA:
            print Fore.WHITE + Back.RED + m
        else:
            print m 
Example #22
Source File: onsets_frames_transcription_realtime.py    From magenta with Apache License 2.0 5 votes vote down vote up
def result_collector(result_queue):
  """Collect and display results."""

  def notename(n, space):
    if space:
      return [' ', '  ', ' ', ' ', '  ', ' ', '  ', ' ', ' ', '  ', ' ',
              '  '][n % 12]
    return [
        Fore.BLUE + 'A' + Style.RESET_ALL,
        Fore.LIGHTBLUE_EX + 'A#' + Style.RESET_ALL,
        Fore.GREEN + 'B' + Style.RESET_ALL,
        Fore.CYAN + 'C' + Style.RESET_ALL,
        Fore.LIGHTCYAN_EX + 'C#' + Style.RESET_ALL,
        Fore.RED + 'D' + Style.RESET_ALL,
        Fore.LIGHTRED_EX + 'D#' + Style.RESET_ALL,
        Fore.YELLOW + 'E' + Style.RESET_ALL,
        Fore.WHITE + 'F' + Style.RESET_ALL,
        Fore.LIGHTBLACK_EX + 'F#' + Style.RESET_ALL,
        Fore.MAGENTA + 'G' + Style.RESET_ALL,
        Fore.LIGHTMAGENTA_EX + 'G#' + Style.RESET_ALL,
    ][n % 12]  #+ str(n//12)

  print('Listening to results..')
  # TODO(mtyka) Ensure serial stitching of results (no guarantee that
  # the blocks come in in order but they are all timestamped)
  while True:
    result = result_queue.get()
    serial = result.audio_chunk.serial
    result_roll = result.result
    if serial > 0:
      result_roll = result_roll[4:]
    for notes in result_roll:
      for i in range(6, len(notes) - 6):
        note = notes[i]
        is_frame = note[0] > 0.0
        notestr = notename(i, not is_frame)
        print(notestr, end='')
      print('|') 
Example #23
Source File: colors.py    From CIRTKit with MIT License 5 votes vote down vote up
def white(text, readline=False):
    return Fore.WHITE + str(text) + Fore.RESET 
Example #24
Source File: display.py    From SQL-scanner with MIT License 5 votes vote down vote up
def primary(self, data): 
        print('\n\n{0}[{1}*{0}] {2}{3}{4}'.format(
            Fore.YELLOW, Fore.GREEN, Fore.WHITE, data, Fore.RESET
        )) 
Example #25
Source File: display.py    From SQL-scanner with MIT License 5 votes vote down vote up
def info(self, msg):
        print('{0}[{1}i{0}] {2}{3}{4}'.format(
            Fore.YELLOW, Fore.CYAN, Fore.WHITE, msg, Fore.RESET
        ))

        sleep(2.5) 
Example #26
Source File: display.py    From SQL-scanner with MIT License 5 votes vote down vote up
def shutdown(self, total=0):
        if total:
            # print('\n{0}[{1}*{0}] {2}Total found: {3}{4}'.format(
            #     Fore.YELLOW, Fore.GREEN, Fore.WHITE, total, Fore.RESET
            # ))

            self.primary('Total found: ' + str(total) )
        else:
            print('')

        print('{0}[{1}!{0}] {2}Shutting Down ...{3}'.format(
            Fore.YELLOW, Fore.RED, Fore.WHITE, Fore.RESET
        ))

        sleep(self.delay) 
Example #27
Source File: display.py    From SQL-scanner with MIT License 5 votes vote down vote up
def is_not_vulner(self, link):
        print('{0}[{1}NO{0}] {2}{3}{4}'.format(
            Fore.WHITE, Fore.RED, Fore.WHITE, link, Fore.RESET
        )) 
Example #28
Source File: display.py    From SQL-scanner with MIT License 5 votes vote down vote up
def is_vulner(self, link):
        print('{0}[{1}OK{0}] {1}{2}{3}'.format(
            Fore.WHITE, Fore.GREEN, link, Fore.RESET
        )) 
Example #29
Source File: program.py    From async-techniques-python-course with MIT License 5 votes vote down vote up
def get_title_range():
    # Please keep this range pretty small to not DDoS my site. ;)

    tasks = []
    for n in range(150, 160):
        tasks.append((n, loop.create_task(get_html(n))))

    for n, t in tasks:
        html = await t
        title = get_title(html, n)
        print(Fore.WHITE + f"Title found: {title}", flush=True) 
Example #30
Source File: Titles.py    From URS with MIT License 5 votes vote down vote up
def title():
        print(Fore.WHITE + Style.BRIGHT + r"""
 __  __  _ __   ____  
/\ \/\ \/\`'__\/',__\ 
\ \ \_\ \ \ \//\__, `\
 \ \____/\ \_\\/\____/
  \/___/  \/_/ \/___/ 
""")

    ### Print Subreddit scraper title.