當前位置: 首頁>>代碼示例>>Python>>正文


Python Fore.LIGHTMAGENTA_EX屬性代碼示例

本文整理匯總了Python中colorama.Fore.LIGHTMAGENTA_EX屬性的典型用法代碼示例。如果您正苦於以下問題:Python Fore.LIGHTMAGENTA_EX屬性的具體用法?Python Fore.LIGHTMAGENTA_EX怎麽用?Python Fore.LIGHTMAGENTA_EX使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在colorama.Fore的用法示例。


在下文中一共展示了Fore.LIGHTMAGENTA_EX屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: show_header

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def show_header():
    print(Fore.LIGHTMAGENTA_EX)
    print("---------------------------")
    print("    Rock Paper Scissors")
    print(" External Libraries Edition")
    print("---------------------------")
    print(Fore.WHITE) 
開發者ID:talkpython,項目名稱:python-for-absolute-beginners-course,代碼行數:9,代碼來源:rpsgame.py

示例2: show_header

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def show_header():
    print(Fore.LIGHTMAGENTA_EX)
    print("---------------------------")
    print("    Rock Paper Scissors")
    print("   Error Handling Edition")
    print("---------------------------")
    print(Fore.WHITE) 
開發者ID:talkpython,項目名稱:python-for-absolute-beginners-course,代碼行數:9,代碼來源:rpsgame.py

示例3: colorize

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def colorize(self, msg):
        """
        Mewarnai pesan
        """

        color = self.color_map[self.record.levelno]
        reset = Style.RESET_ALL
        levelname = reset + color + self.record.levelname + reset
        if self.record.levelname == "CRITICAL":
            color = self.color_map[logging.ERROR]

        name = Fore.LIGHTBLUE_EX + self.record.name + reset
        message = self.record.message
        # XXX: kenapa cara dibawah ini tidak bekerja?
        #
        # match = re.findall(r"['\"]+(.*?)['\"]+", message)
        # if match:
        #     match.reverse()
        #     for m in match:
        #         message = message.replace(m, color + m + reset, 1)

        match = re.search(r"=> (?P<account>.*?(?:| \: .*?)) \((?P<status>[A-Z]+)\)", message)
        if match:
            account = match.group("account")
            status = match.group("status")
            if status == "NO":
                color_status = Fore.LIGHTRED_EX
            else:
                color_status = Fore.LIGHTGREEN_EX

            newmsg = message.replace(account, color_status + account + reset)
            newmsg = newmsg.replace(status, color_status + status + reset)
            msg = msg.replace(message, newmsg)

        asctime = re.findall(r"\[(.+?)\]", msg)[0]
        msg = msg.replace(asctime, Fore.LIGHTMAGENTA_EX + asctime + reset, 1)
        msg = msg.replace(self.record.name, name, 1)
        msg = msg.replace(self.record.levelname, levelname, 1)
        msg = msg + reset

        return msg 
開發者ID:brutemap-dev,項目名稱:brutemap,代碼行數:43,代碼來源:logger.py

示例4: print_after

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def print_after(self, path):
        print(Fore.LIGHTBLUE_EX + "\nFolders after cleaning\n" + Fore.RESET)

        for files in os.listdir(path):
            print(files, sep=',\t')

        print(Fore.LIGHTMAGENTA_EX + "\nCLEANED\n" + Fore.RESET) 
開發者ID:sukeesh,項目名稱:Jarvis,代碼行數:9,代碼來源:file_organise.py

示例5: print_after

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def print_after(path):

	print(Fore.LIGHTBLUE_EX  + "\nAfter cleaning\n" + Fore.RESET)

	for files in os.listdir(path):
		print(files,end='\t')

	print(Fore.LIGHTMAGENTA_EX  + "\n\nCLEANED\n" + Fore.RESET) 
開發者ID:umangahuja1,項目名稱:Scripting-and-Web-Scraping,代碼行數:10,代碼來源:clean_folder.py

示例6: _info_

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def _info_(*msgs):
        return f'{Fore.LIGHTMAGENTA_EX}{" ".join(msgs)}{Style.RESET_ALL}' 
開發者ID:kyb3r,項目名稱:modmail,代碼行數:4,代碼來源:models.py

示例7: result_collector

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
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('|') 
開發者ID:magenta,項目名稱:magenta,代碼行數:40,代碼來源:onsets_frames_transcription_realtime.py

示例8: bright

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def bright(line):
    print(Fore.LIGHTMAGENTA_EX + line + Style.RESET_ALL) 
開發者ID:mikechabot,項目名稱:smtp-email-spoofer-py,代碼行數:4,代碼來源:logger.py

示例9: print_choice

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTMAGENTA_EX [as 別名]
def print_choice(beg, end, SONG_INFO, type):
    """Print the available choices."""
    # Check if end is more than length of SONG_INFO
    if end > len(SONG_INFO):
        end = len(SONG_INFO)

    while beg != end:
        print(Fore.LIGHTMAGENTA_EX, end='')
        print(' [' + str(beg+1) + '] ', end='')
        print(Style.RESET_ALL, end='')
        print(Fore.LIGHTCYAN_EX, end='')
        if type == 'metadata':
            print(SONG_INFO[beg].track_name, end='')
        if type == 'mp3':
            print(SONG_INFO[beg]['title'], end='')
        print(Style.RESET_ALL, end='')
        print(' by ', end='')
        print(Fore.YELLOW, end='')
        if type == 'metadata':
            print(SONG_INFO[beg].artist_name, end='')
        if type == 'mp3':
            print(SONG_INFO[beg]['author_name'], end='')
            print(Style.RESET_ALL, end='')
            print(' with dur ', end='')
            print(Fore.GREEN, end='')
            print("{}".format(SONG_INFO[beg]['duration']), end='')
        print(Style.RESET_ALL)

        beg += 1

    # Before exiting print another choice to show more
    if end < len(SONG_INFO):
        print(Fore.LIGHTMAGENTA_EX, end='')
        print(' [0]', end='')
        print(Style.RESET_ALL, end='')
        print(Fore.YELLOW, end='')
        print(' More results')
        print(Style.RESET_ALL, end='') 
開發者ID:deepjyoti30,項目名稱:ytmdl,代碼行數:40,代碼來源:song.py


注:本文中的colorama.Fore.LIGHTMAGENTA_EX屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。