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


Python console.Console方法代码示例

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


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

示例1: main

# 需要导入模块: import console [as 别名]
# 或者: from console import Console [as 别名]
def main():
    parser = argparse.ArgumentParser(
        prog='ArtStationDownloader',
        description='ArtStation Downloader is a lightweight tool to help you download images and videos from the ArtStation')
    parser.add_argument('--version', action='version',
                        version='%(prog)s '+__version__)
    parser.add_argument('-u', '--username',
                        help='choose who\'s project you want to download, one or more', nargs='*')
    parser.add_argument('-d', '--directory', help='output directory')
    parser.add_argument(
        '-t', '--type', choices=['all', 'image', 'video'], default="all", help='what do you what to download, default is all')
    parser.add_argument('-v', '--verbosity', action="count",
                        help="increase output verbosity")
    args = parser.parse_args()

    if args.username:
        if args.directory:
            console = Console()
            console.download_by_usernames(args.username, args.directory, args.type)
        else:
            print("no output directory, please use -d or --directory option to set")
    else:
        app = App(version=__version__)
        app.mainloop()  # 进入主循环,程序运行 
开发者ID:findix,项目名称:ArtStationDownloader,代码行数:26,代码来源:ArtStationDownloader.py

示例2: create_console_tab

# 需要导入模块: import console [as 别名]
# 或者: from console import Console [as 别名]
def create_console_tab(self):
        from console import Console
        self.console = console = Console()
        return console 
开发者ID:mazaclub,项目名称:encompass,代码行数:6,代码来源:main_window.py

示例3: __init__

# 需要导入模块: import console [as 别名]
# 或者: from console import Console [as 别名]
def __init__(self):
        """
        Pull all variables from config.py file.
        """

        self.player = Player()
        self.database = config.database
        self.Max_point_tournament = config.Max_point_tournament
        self.BotNet_update = config.BotNet_update
        self.joinTournament = config.joinTournament
        self.tournament_potator = config.tournament_potator
        self.booster = config.booster
        self.Use_netcoins = config.Use_netcoins
        self.attacks_normal = config.attacks_normal
        self.updates = config.updates
        self.updatecount = config.updatecount
        self.maxanti_normal = config.maxanti_normal
        self.active_cluster_protection = config.active_cluster_protection
        self.mode = config.mode
        self.number_task = config.number_task
        self.min_energy_botnet = config.minimal_energy_botnet_upgrade
        self.stat = "0"
        self.wait_load = config.wait_load
        self.c = Console(self.player)
        self.u = Update(self.player)
        # disable botnet for > api v13
        self.b = Botnet(self.player)
        self.ddos = ddos.Ddos(self.player)
        self.m = Mails(self.player)
        self.init() 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:32,代码来源:main.py

示例4: __init__

# 需要导入模块: import console [as 别名]
# 或者: from console import Console [as 别名]
def __init__(self, player):
        self.ddos_cluster = config.ddos_cluster
        self.database = config.database
        self.Max_point_tournament = config.Max_point_tournament
        self.username = player.username
        self.password = player.password
        self.uhash = player.uhash
        self.c = console.Console(player) 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:10,代码来源:ddos.py

示例5: __init__

# 需要导入模块: import console [as 别名]
# 或者: from console import Console [as 别名]
def __init__(self, name="MianBot", build_console=True, w2v_model_path="model/ch-corpus-3sg.bin"):

        """
        # Args:
         - build_console: 是否要建構依照詞向量進行主題匹配的 console,
         如果只需要 qa 模組,可將 build_console 關閉,可見 demo_qa.py
        """

        self.name = name             # The name of chatbot.

        self.speech = ''             # The lastest user's input
        self.speech_domain = ''      # The domain of speech.
        self.speech_matchee = ''     # The matchee term of speech.
        self.speech_path = None      # The classification tree traveling path of speech.
        self.speech_seg = []

        self.root_domain = None      # The root domain of user's input.
        self.domain_similarity = 0.0 # The similarity between domain and speech.

        cur_dir = os.getcwd()
        os.chdir(os.path.dirname(__file__))
        self.extract_attr_log = open('log/extract_arrt.log','w',encoding='utf-8')
        self.exception_log = open('log/exception.log','w',encoding='utf-8')
        os.chdir(cur_dir)

        # For rule matching
        if build_console:
            self.console = console.Console(model_path=w2v_model_path)
            # self.custom_rulebase = crb.CustomRuleBase() # for one time matching.
            # self.custom_rulebase.model = self.console.rb.model # pass word2vec model

        # For Question Answering
        self.github_qa_unupdated = False
        if not self.github_qa_unupdated:

            try:
                self.answerer = qa.Answerer()
            except Exception as exc:
                print("[QA] 請確認問答資料集的目錄結構是否正確")
                print("[QA] 如尚未取得問答資料集, 請至 Github: zake7749/Chatbot/Readme.md 中下載, 或將 self.github_qa_unupdated 設為 true")

        self.default_response = [
            "是嗎?",
            "我不太明白你的意思",
            "原來如此"
        ] 
开发者ID:zake7749,项目名称:Chatbot,代码行数:48,代码来源:chatbot.py


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