当前位置: 首页>>代码示例>>Python>>正文


Python Back.MAGENTA属性代码示例

本文整理汇总了Python中colorama.Back.MAGENTA属性的典型用法代码示例。如果您正苦于以下问题:Python Back.MAGENTA属性的具体用法?Python Back.MAGENTA怎么用?Python Back.MAGENTA使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在colorama.Back的用法示例。


在下文中一共展示了Back.MAGENTA属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: magentaback

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import MAGENTA [as 别名]
def magentaback(s):
    """Magenta background"""
    return Back.MAGENTA + s + Back.RESET 
开发者ID:abisee,项目名称:cs224n-win18-squad,代码行数:5,代码来源:pretty_print.py

示例2: __call__

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import MAGENTA [as 别名]
def __call__(self, jarvis, s):
        prompt = "{black}Q{Q_id} {cyan}{left} {black}--- {green}{right}"
        prompt_formatter = {
            'cyan': Fore.CYAN,
            'black': Fore.BLACK,
            'green': Fore.GREEN
        }
        jarvis.say("Start personality test..", color=Fore.BLACK)
        jarvis.say(self.instruction)
        for i, (Q_id, left, right) in enumerate(self.Q):
            prompt_formatter['Q_id'] = i
            prompt_formatter['left'] = left
            prompt_formatter['right'] = right

            jarvis.say(prompt.format(**prompt_formatter))
            user_input = jarvis.input_number(
                prompt="Enter your choice on the scale of 1-5:\n", rmin=1,
                rmax=5, color=Fore.BLUE, rtype=int)
            self.answers[Q_id] = user_input
        self.get_scores()

        jarvis.say(
            "{}Your personality is: {}{}{}{}".format(
                Fore.BLUE,
                Fore.BLACK,
                Back.MAGENTA,
                self.type,
                Style.RESET_ALL))
        jarvis.say(
            "Redirecting to your personality analysis\
                 in 3s...", color=Fore.BLUE)
        time.sleep(3)
        self.open_analysis() 
开发者ID:sukeesh,项目名称:Jarvis,代码行数:35,代码来源:personality.py

示例3: recv

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import MAGENTA [as 别名]
def recv(self, str, mode):
    if str: print(Back.MAGENTA + str + Style.RESET_ALL)
    if str and mode == 'hex':
      print(Fore.MAGENTA + conv().hex(str, ':') + Style.RESET_ALL)

  # show information 
开发者ID:RUB-NDS,项目名称:PRET,代码行数:8,代码来源:helper.py

示例4: caller

# 需要导入模块: from colorama import Back [as 别名]
# 或者: from colorama.Back import MAGENTA [as 别名]
def caller(self, proxy):
        """ Populate the XML-RPC system.multicall() with the maximum number of predefined
            of subrequests and then fire it. 
        """
        
        calls = 0
        global exit_flag

        pbar = tqdm(self.queue.qsize(), desc=self.name, total=self.queue.qsize(), unit='multicall', unit_scale=True, dynamic_ncols=True)

        while not self.queue.empty() and not exit_flag:
            chunks_size = self.queue.get()
            multicall = xmlrpc.client.MultiCall(proxy)

            for passwords in chunks_size:
                # Can be any other available method that needs auth.
                multicall.wp.getUsersBlogs(self.username, passwords.strip())

            try:
                if self.verbose:
                    pbar.write(Fore.MAGENTA + "[{}]".format(self.name) + TRAFFIC_OUT + "XML request [#{}]:".format(calls))
                    pbar.write("{}".format(chunks_size) + Style.RESET_ALL)
                
                res = multicall()
            except:
                pbar.write(ERROR + "could not make an XML-RPC call" + Style.RESET_ALL)
                continue

            if self.verbose:
                pbar.write(Back.MAGENTA + "[{}]".format(self.name) + TRAFFIC_IN + "XML response [#{}] (200 OK):".format(calls))
                pbar.write("{}".format(res.results) + Style.RESET_ALL)

            if re.search("isAdmin", str(res.results), re.MULTILINE):
                i = 0

                for item in res.results:
                    if re.search(r"'isAdmin': True", str(item)):
                        exit_flag = True    
                        # let time for the threads to terminate
                        time.sleep(2)
                    	# pbar.write() seems to be bugged at the moment
                        pbar.write(RESULT + "found a match: \"{0}:{1}\"".format(self.username, chunks_size[i].strip()) + Style.RESET_ALL)
                        # Log the password in case sys.stdout acts dodgy
                        with open("passpot.pot", "a+") as logfile:
                        	logfile.write("{0} - {1}:{2}\n".format(self.xmlrpc_intf, self.username, chunks_size[i].strip()))
                        break 

                    i += 1
            
            calls += 1
            self.queue.task_done()
            pbar.update()

        pbar.close() 
开发者ID:aress31,项目名称:xmlrpc-bruteforcer,代码行数:56,代码来源:xmlrpc-bruteforcer.py


注:本文中的colorama.Back.MAGENTA属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。