Python console.Console() Examples
The following are 5
code examples of console.Console().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
console
, or try the search function
.
Example #1
Source File: ArtStationDownloader.py From ArtStationDownloader with MIT License | 6 votes |
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() # 进入主循环,程序运行
Example #2
Source File: main_window.py From encompass with GNU General Public License v3.0 | 5 votes |
def create_console_tab(self): from console import Console self.console = console = Console() return console
Example #3
Source File: main.py From vHackXTBot-Python with MIT License | 5 votes |
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()
Example #4
Source File: ddos.py From vHackXTBot-Python with MIT License | 5 votes |
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)
Example #5
Source File: chatbot.py From Chatbot with GNU General Public License v3.0 | 4 votes |
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 = [ "是嗎?", "我不太明白你的意思", "原來如此" ]