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


Python win_unicode_console.enable方法代碼示例

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


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

示例1: set_colors

# 需要導入模塊: import win_unicode_console [as 別名]
# 或者: from win_unicode_console import enable [as 別名]
def set_colors():
	global G, Y, B, R, W , M , C , end ,Bold,underline
	if os.name=="nt":
		try:
			import win_unicode_console , colorama
			win_unicode_console.enable()
			colorama.init()
			#green - yellow - blue - red - white - magenta - cyan - reset
			G,Y,B,R,W,M,C,end= '\033[92m','\033[93m','\033[94m','\033[91m','\x1b[37m','\x1b[35m','\x1b[36m','\033[0m'
			Bold = "\033[1m"
			underline = "\033[4m"
		except:
			G = Y = B = R = W = G = Y = B = R = Bold = underline = ''
	else:
		#import colorama
		#colorama.init()
		#green - yellow - blue - red - white - magenta - cyan - reset
		G,Y,B,R,W,M,C,end= '\033[92m','\033[93m','\033[94m','\033[91m','\x1b[37m','\x1b[35m','\x1b[36m','\033[0m'
		Bold = "\033[1m"
		underline = "\033[4m" 
開發者ID:D4Vinci,項目名稱:Cr3dOv3r,代碼行數:22,代碼來源:color.py

示例2: init_output

# 需要導入模塊: import win_unicode_console [as 別名]
# 或者: from win_unicode_console import enable [as 別名]
def init_output():
    import colorama
    win_unicode_console.enable()
    colorama.init() 
開發者ID:nvbn,項目名稱:thefuck,代碼行數:6,代碼來源:win32.py

示例3: set_colors

# 需要導入模塊: import win_unicode_console [as 別名]
# 或者: from win_unicode_console import enable [as 別名]
def set_colors():
	global G, Y, B, R, W , M , C , end
	if sys.platform.startswith('win'):
		# Windows deserve coloring too :D
		try:
			import win_unicode_console , colorama
			win_unicode_console.enable()
			colorama.init()
			#Now the unicode will work ^_^
			G = '\033[92m'  # green
			Y = '\033[93m'  # yellow
			B = '\033[94m'  # blue
			R = '\033[91m'  # red
			W = '\033[0m'   # white
			M = '\x1b[35m'  # magenta
			C = '\x1b[36m'  # cyan
			end = '\33[97m'
		except:
			#print("[!] Error: Coloring libraries not installed ,no coloring will be used [Check the readme]")
			G = Y = B = R = W = G = Y = B = R = W = ''
	else:
		G = '\033[92m'  # green
		Y = '\033[93m'  # yellow
		B = '\033[94m'  # blue
		R = '\033[91m'  # red
		W = '\033[0m'   # white
		M = '\x1b[35m'  # magenta
		C = '\x1b[36m'  # cyan
		end = '\33[97m' 
開發者ID:D4Vinci,項目名稱:Dr0p1t-Framework,代碼行數:31,代碼來源:color.py

示例4: init

# 需要導入模塊: import win_unicode_console [as 別名]
# 或者: from win_unicode_console import enable [as 別名]
def init():
    os.environ['version'] = get_version()

    win_unicode_console.enable()
    colorama.init()
    description()

    args = get_args()

    levels = ['NOTSET', 'WARN', 'INFO', 'DEBUG']
    level = os.getenv('LOG_LEVEL')
    if not level:
        level = levels[args.log] if args.log else 'NOTSET'
    # end if
    if level != 'NOTSET':
        os.environ['debug_mode'] = 'yes'
        logging.basicConfig(
            level=logging.getLevelName(level),
            format=Fore.CYAN + '%(asctime)s '
            + Fore.RED + '[%(levelname)s] '
            + Fore.YELLOW + '(%(name)s)\n'
            + Fore.WHITE + '%(message)s' + Fore.RESET,
        )
        debug_mode(level)
    # end if

    if args.suppress:
        input_suppression()
        print(args)
    # end if

    if args.bot:
        os.environ['BOT'] = args.bot
    # end if

    for key, val in args.extra.items():
        os.environ[key] = val[0]
    # end for

    # requests.urllib3.disable_warnings(
    #     requests.urllib3.exceptions.InsecureRequestWarning)
    # # end if
# end def 
開發者ID:dipu-bd,項目名稱:lightnovel-crawler,代碼行數:45,代碼來源:__init__.py

示例5: processProject

# 需要導入模塊: import win_unicode_console [as 別名]
# 或者: from win_unicode_console import enable [as 別名]
def processProject(vbaParser, args, output_file = sys.stdout):
    try:
        vbaProjects = vbaParser.find_vba_projects()
        if vbaProjects is None:
            return
        if output_file.isatty() and WIN_UNICODE_CONSOLE:
            win_unicode_console.enable()
        for vbaRoot, _, dirPath in vbaProjects:
            print('=' * 79, file=output_file)
            if not args.disasmOnly:
                print('dir stream: {}'.format(dirPath), file=output_file)
            dirData, codeModules, is64bit = processDir(vbaParser, dirPath, args, output_file=output_file)
            vbaProjectPath = vbaRoot + 'VBA/_VBA_PROJECT'
            vbaProjectData = process_VBA_PROJECT(vbaParser, vbaProjectPath, args, output_file=output_file)
            identifiers = getTheIdentifiers(vbaProjectData)
            if not args.disasmOnly:
                print('Identifiers:', file=output_file)
                print('', file=output_file)
                i = 0
                for identifier in identifiers:
                    print('{:04X}: {}'.format(i, identifier), file=output_file)
                    i += 1
                print('', file=output_file)
                print('_VBA_PROJECT parsing done.', file=output_file)
                print('-' * 79, file=output_file)
            print('Module streams:', file=output_file)
            for module in codeModules:
                modulePath = vbaRoot + 'VBA/' + module
                # make sure it is unicode, because that is what vbaParser expects:
                if PYTHON2:
                    # modulePath is UTF8 bytes (see processDir)
                    modulePath_unicode = modulePath.decode('utf8', errors='replace')
                else:
                    # modulePath is already unicode
                    modulePath_unicode = modulePath
                moduleData = vbaParser.ole_file.openstream(modulePath_unicode).read()
                print ('{} - {:d} bytes'.format(modulePath, len(moduleData)), file=output_file)
                pcodeDump(moduleData, vbaProjectData, dirData, identifiers, is64bit, args, output_file=output_file)
        if output_file.isatty() and WIN_UNICODE_CONSOLE:
            win_unicode_console.disable()
    except Exception as e:
        print('Error: {}.'.format(e), file=sys.stderr) 
開發者ID:bontchev,項目名稱:pcodedmp,代碼行數:44,代碼來源:pcodedmp.py

示例6: main

# 需要導入模塊: import win_unicode_console [as 別名]
# 或者: from win_unicode_console import enable [as 別名]
def main():
    """
    Run main script
    """
    global R, B, C, W, Y, url, spinner
    sys.path.append(os.path.dirname(os.path.realpath(__file__)))
    import spin
    R, B, Y, C, W = '\033[1;31m', '\033[1;37m', '\033[93m', '\033[1;30m', '\033[0m'
    args = vars(parse_args())
    
    
    # OS Compatibility : Coloring
   
    if sys.platform.startswith('win'):
        try:
            import win_unicode_console, colorama
            win_unicode_console.enable()
            colorama.init()
        except:
            print('[+] Error: Coloring libraries not installed')
            R, B, Y, C, W = '', '', '', '', ''
    
    if len(sys.argv) < 2 :
        header()
        print('{}Usage: r3con1z3r -d domain.com\n'.format(Y, C))
        print('{}Example: r3con1z3r -d google.com\n'.format(Y, C))
        print('{}[!] Please specify a domain'.format(Y, C))
        sys.exit()
    else:
        if args['about']:
            about()
        else: 
            url = args['domain']
            if  url[0:8] == 'https://':
                url = url.replace("https://","")
            elif url[0:7] == 'http://':
                url = url.replace("http://","")
            else:
                url = url
                
                # declare global spinner
                spinner = spin.create_spinner(before="Generating Report")
                gaphy() 
開發者ID:abdulgaphy,項目名稱:r3con1z3r,代碼行數:45,代碼來源:cli.py


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