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


Python run.run方法代碼示例

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


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

示例1: run

# 需要導入模塊: import run [as 別名]
# 或者: from run import run [as 別名]
def run(self):
        """Run the Playbook App.

        Returns:
            int: The exit code fo the App.
        """
        from run import run

        # run the app
        exit_code = 0
        try:
            run()
        except SystemExit as e:
            exit_code = e.code

        self.log.data('run', 'Exit Code', exit_code)
        return exit_code 
開發者ID:ThreatConnect-Inc,項目名稱:tcex,代碼行數:19,代碼來源:test_case_job.py

示例2: init

# 需要導入模塊: import run [as 別名]
# 或者: from run import run [as 別名]
def init(nameList, productList, matrix):
    if isinstance(productList, int):
        products = m.mockProducts(productList)
    p.addProducts(products)
    if isinstance(nameList, int):
        nameList = m.mockCustomers(nameList)
    addCustomers(nameList)

    if isinstance(matrix, list):
        '''expected data: list of customers, list of products, list customer arrays containing 
        product purchases in same order as product list.'''
        dataBuilder(matrix);
    else:
        m.mockDataBuilder(names, products)
    c.matrixBuilder()

    recommend = run.run(names, matrix)
    while recommend == 'again':
        recommend = run.run(names, matrix)
    return recommend 
開發者ID:lramsey,項目名稱:product-recommender,代碼行數:22,代碼來源:init.py

示例3: run_profile

# 需要導入模塊: import run [as 別名]
# 或者: from run import run [as 別名]
def run_profile(self):
        """Run an App using the profile name."""
        self.create_shelf_dir(self.profile.tc_temp_path)

        # create encrypted config file
        self.create_config(self.profile.args)

        # run the service App in 1 of 3 ways
        if self.run_method == 'inline':
            # backup sys.argv
            sys_argv_orig = sys.argv

            # clear sys.argv
            sys.argv = sys.argv[:1]

            # run the App
            exit_code = self.run()

            # restore sys.argv
            sys.argv = sys_argv_orig
        elif self.run_method == 'subprocess':
            # run the Service App as a subprocess
            app_process = subprocess.Popen(['python', 'run.py'])
            exit_code = app_process.wait()

        # run the App
        return exit_code 
開發者ID:ThreatConnect-Inc,項目名稱:tcex,代碼行數:29,代碼來源:test_case_job.py

示例4: my_main

# 需要導入模塊: import run [as 別名]
# 或者: from run import run [as 別名]
def my_main(_run, _config, _log, env_args):
    global mongo_client

    # Setting the random seed throughout the modules
    np.random.seed(_config["seed"])
    th.manual_seed(_config["seed"])
    env_args['seed'] = _config["seed"]

    # run the framework
    run(_run, _config, _log, mongo_client)

    # force exit
    os._exit() 
開發者ID:schroederdewitt,項目名稱:mackrl,代碼行數:15,代碼來源:main.py

示例5: my_main

# 需要導入模塊: import run [as 別名]
# 或者: from run import run [as 別名]
def my_main(_run, _config, _log):
    # Setting the random seed throughout the modules
    config = config_copy(_config)
    np.random.seed(config["seed"])
    th.manual_seed(config["seed"])
    config['env_args']['seed'] = config["seed"]

    # run the framework
    run(_run, config, _log) 
開發者ID:oxwhirl,項目名稱:pymarl,代碼行數:11,代碼來源:main.py


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