本文整理汇总了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
示例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
示例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
示例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()
示例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)