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


Python Fore.LIGHTGREEN_EX屬性代碼示例

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


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

示例1: chapters

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def chapters(url, course_folder_path):
    ''' create chapters folder '''
    soup = create_soup(url)
    heading4 = soup.find_all('h4', {"class": "ga"})
    chapter_no = 0

    message.colored_message(Fore.LIGHTYELLOW_EX, "Creating Chapters:\n") # Print message

    
    for h in heading4:
        chapter = format_chapter(h.text, chapter_no)
        chapter_no += 1
        message.print_line(chapter)

        new_chapter = course_folder_path + "/" + chapter
        new_chapter = new_chapter.strip()
        os.mkdir(new_chapter) # create folders (chapters)
            
    message.colored_message(Fore.LIGHTGREEN_EX, '\n✅  '+str(chapter_no)+' chapters created!!\n') 
開發者ID:ankitsejwal,項目名稱:Lyndor,代碼行數:21,代碼來源:save.py

示例2: PREPEND

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def PREPEND(state):
    """PREPEND is used to print ==> in front of the lines.

    They are colorised according to their status.
    If everything is good then green else red.
    """
    # State 1 is for ok
    # State 2 is for notok

    print(Style.BRIGHT, end='')
    if state == 1:
        print(Fore.LIGHTGREEN_EX, end='')
    elif state == 2:
        print(Fore.LIGHTRED_EX, end='')
    else:
        pass

    print(' ==> ', end='')
    print(Style.RESET_ALL, end='') 
開發者ID:deepjyoti30,項目名稱:ytmdl,代碼行數:21,代碼來源:prepend.py

示例3: colorize

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_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: pbanner

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def pbanner():
    return Style.BRIGHT + Fore.LIGHTGREEN_EX + banner + Style.RESET_ALL 
開發者ID:quantumcore,項目名稱:supercharge,代碼行數:4,代碼來源:banner.py

示例5: print_success

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def print_success(*args, **kwargs):
    __cprint(Fore.LIGHTGREEN_EX + '[+]' + Fore.RESET, *args, **kwargs) 
開發者ID:d0ubl3g,項目名稱:Industrial-Security-Auditing-Framework,代碼行數:4,代碼來源:__init__.py

示例6: main

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def main():
    ''' Main function '''
    init()
    message.animate_characters(Fore.LIGHTYELLOW_EX, draw.ROCKET, 0.02)
    message.spinning_cursor()
    message.print_line('\r1. Paste course url or\n' +
    '2. Press enter for Bulk Download')
    
    url = input()
    
    print('')
    start_time = time.time() #start time counter begins
    if url == "":
        # If user press Enter (i.e. url empty), get urls from Bulkdownload.txt
        urls = read.bulk_download()
        if not urls:
            sys.exit(message.colored_message(Fore.LIGHTRED_EX, 'Please paste urls in Bulk Download.txt\n'))
        for url in urls:
            schedule_download(url)
    else:
        # begin regular download
        schedule_download(url)
    try:
        end_time = time.time()
        message.animate_characters(Fore.LIGHTGREEN_EX, draw.COW, 0.02)
        message.colored_message(Fore.LIGHTGREEN_EX, "\nThe whole process took {}\n".format(move.hms_string(end_time - start_time)))
    except KeyboardInterrupt:
        sys.exit(message.colored_message(Fore.LIGHTRED_EX, "\n- Program Interrupted!!\n")) 
開發者ID:ankitsejwal,項目名稱:Lyndor,代碼行數:30,代碼來源:run.py

示例7: course

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def course(url, lynda_folder_path):
    ''' create course folder '''
    current_course = course_path(url, lynda_folder_path)
    courses = os.listdir(lynda_folder_path)

    answer = None
    for course in courses:
        if (lynda_folder_path + course) == current_course:
            if read.redownload_course == 'force':
                # delete existing course and re-download
                shutil.rmtree(current_course)
                message.colored_message(Fore.LIGHTRED_EX, "\n✅  Course folder already exists. Current preference -> FORCE redownload")
                message.colored_message(Fore.LIGHTRED_EX, "\n❌  Existing course folder deleted!!")
                time.sleep(2)
                message.colored_message(Fore.LIGHTGREEN_EX, "\n♻️  Re-downloading the course.\n")
                time.sleep(2)
            elif read.redownload_course == 'skip':
                # skip download process
                message.colored_message(Fore.LIGHTRED_EX, "\n✅  Course folder already exists. Current preference -> SKIP redownload")
                sys.exit(message.colored_message(Fore.LIGHTRED_EX, "\n-> Skipping course download.\n"))    
            elif read.redownload_course == 'prompt':
                # prompt user with available choices
                QUESTION = '\n✅  Course folder already exists: Do you wish to delete it and download again? (Y/N): '
                sys.stdout.write(Fore.LIGHTBLUE_EX + QUESTION + Fore.RESET)
                while answer != 'y':
                    # get user input
                    answer = input().lower()

                    if answer == 'y':
                        shutil.rmtree(current_course)
                        message.colored_message(Fore.LIGHTRED_EX, "\n❌  Existing course folder deleted!!")
                        time.sleep(2)
                        message.colored_message(Fore.LIGHTGREEN_EX, "\n♻️  Re-downloading the course.\n")
                    elif answer == 'n':
                        sys.exit(message.colored_message(Fore.LIGHTRED_EX, "\n-> Program Ended!!\n"))
                    else:
                        sys.stdout.write(Fore.LIGHTRED_EX + "\n- oops!! that's not a valid choice, type Y or N: " + Fore.RESET)
    
    print(f'\ncreating course folder at: {current_course}')
    os.mkdir(current_course) 
開發者ID:ankitsejwal,項目名稱:Lyndor,代碼行數:42,代碼來源:save.py

示例8: display_title

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def display_title(self):

        print((Fore.LIGHTGREEN_EX + "Webpage: " + Fore.RESET) + (Fore.WHITE + self.soup.title.string + Fore.RESET))
        print("\n") 
開發者ID:kaiiyer,項目名稱:webtech,代碼行數:6,代碼來源:scrape.py

示例9: display_header

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def display_header(self):
        print(Fore.LIGHTGREEN_EX + "HEADER TAGS: " +  Fore.RESET + "\n")
        titles = self.soup.find_all(['h1' , 'h2', 'h3' , 'h4' , 'h5' , 'h6'])
        for i in titles:
            print(i)

        print("\n") 
開發者ID:kaiiyer,項目名稱:webtech,代碼行數:9,代碼來源:scrape.py

示例10: display_links

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def display_links(self):

        links = self.soup.find_all("a")
        print(Fore.LIGHTGREEN_EX + "LINKS: " +  Fore.RESET + "\n")
        for ind, val in enumerate(links):
            print((Fore.CYAN +  val.text + "_link{ind+1}: " + Fore.RESET) + val.attrs["href"]) 
開發者ID:kaiiyer,項目名稱:webtech,代碼行數:8,代碼來源:scrape.py

示例11: compare

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def compare(path=None, *fields, **kwfields):
    store = {}
    getters = Getters(fields, kwfields)

    def _compare(old, new):
        if isinstance(old, dict):
            return {k: _compare(v, new[k]) for k, v in old.items()}
        elif isinstance(old, (int, float)):
            diff = new - old
            if diff == 0:
                return old
            c = Fore.LIGHTGREEN_EX if diff > 0 else Fore.LIGHTRED_EX
            diff = f"+{diff}" if diff > 0 else str(diff)
            return f"{old} -> {new} ({_color(c, diff)})"
        elif hasattr(old, "compare"):
            return old.compare(new)
        elif old == new:
            return old
        else:
            return f"{old} -> {new}"

    def _enter(_curpath, **kwargs):
        _path = _curpath[:-6]
        w = breakword.word()
        store[_path] = (w, getters(kwargs))
        _brk(w)

    def _exit(_curpath, **kwargs):
        if "success" in kwargs and not kwargs["success"]:
            return
        _path = _curpath[:-5]
        w, old = store[_path]
        new = getters(kwargs)
        _display(_path, _compare(old, new), word=w, brk=False)

    path = _resolve_path(path, variant="cmp")
    return DoTrace({f"{path}/enter": _enter, f"{path}/exit": _exit}) 
開發者ID:mila-iqia,項目名稱:myia,代碼行數:39,代碼來源:trace.py

示例12: url_supported_list

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def url_supported_list():
    print('Supported sources:')
    for url in sorted(crawler_list.keys()):
        print(Fore.LIGHTGREEN_EX, Icons.RIGHT_ARROW, url, Fore.RESET)
    # end for
# end def 
開發者ID:dipu-bd,項目名稱:lightnovel-crawler,代碼行數:8,代碼來源:display.py

示例13: print_help

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def print_help():
    terminal(CMD_CLEAR_TERM)
    print(Fore.LIGHTGREEN_EX + 'PROX v0.2 - Utility for checking proxy in terminal')
    print(Fore.LIGHTGREEN_EX + 'Authors: Hasanov Abdurahmon & Ilyosiddin Kalandar')
    print(Fore.LIGHTCYAN_EX)
    print('Usage -> prox -f <filename> - Check file with proxies')
    print('prox -p <proxy> - check only one proxy')
    print('prox --help - show this menu') 
開發者ID:pythonism,項目名稱:proxy-checker,代碼行數:10,代碼來源:prox.py

示例14: success

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

示例15: disass_instruction

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTGREEN_EX [as 別名]
def disass_instruction(uc, instr, addr_alias="", columns=False):
    if instr.id == 0:
        pass
    (regs_read, regs_write) = instr.regs_access()
    reg_values = {}
    for r in regs_read:
        uc_constant = getattr(unicorn.x86_const, f"UC_X86_REG_{instr.reg_name(r).upper()}", None)
        if uc_constant:
            reg_values[instr.reg_name(r)] = uc.reg_read(uc_constant)
    reg_values_str = ' '.join([f"{name}=0x{value:02x}" for name, value in reg_values.items()])
    if X86_GRP_JUMP in instr.groups:
        if jump_taken(uc, instr):
            color = Fore.LIGHTGREEN_EX
            comment = f"; taken! {reg_values_str}"
        else:
            color = Fore.LIGHTRED_EX
            comment = f"; not taken! {reg_values_str}"
    else:
        color = Fore.RESET
        comment = f"; {reg_values_str}" if reg_values_str else ""
    mnemonic = f"{color}{instr.mnemonic}{Fore.RESET}"
    addr_alias = f"0x{instr.address:02x}, {Fore.LIGHTRED_EX}{addr_alias}{Fore.RESET}" if addr_alias \
        else f"0x{instr.address:02x}"

    disass_cols = f">>> {addr_alias}:", f"{mnemonic} {Fore.LIGHTCYAN_EX}{instr.op_str}{Fore.RESET}", f"{Fore.LIGHTBLUE_EX}{comment}{Fore.RESET}"
    if columns:
        return disass_cols
    return " ".join(disass_cols) 
開發者ID:unipacker,項目名稱:unipacker,代碼行數:30,代碼來源:utils.py


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