本文整理汇总了Python中subprocess.Popen.map方法的典型用法代码示例。如果您正苦于以下问题:Python Popen.map方法的具体用法?Python Popen.map怎么用?Python Popen.map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subprocess.Popen
的用法示例。
在下文中一共展示了Popen.map方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from subprocess import Popen [as 别名]
# 或者: from subprocess.Popen import map [as 别名]
def main(argv):
bgps = []
FNULL = open(os.devnull, 'w')
for i in range(0, 5):
p = Popen(['mono', '../TestingApplication/bin/Release/TestingApplication.exe',
'-server' + str(11000 + i), '../TestingApplication/bin/Release/Cyclops_caida_new.txt'],
stdout=FNULL, stderr=subprocess.STDOUT)
bgps.append(p)
time.sleep(5)
'''
threads = []
for i in range(0, 10):
t = compThread(i, (11000+i), (100 * i, 100 * (i+1)))
t.start()
threads.append(t)
for t in threads:
t.join()
'''
data = []
for i in range(0, 5):
data.append((11000+i, 100 * i, 100 * (i+1)))
p = Pool(5)
p.map(processAlexa, data)
for p in bgps:
p.terminate()
示例2: submit
# 需要导入模块: from subprocess import Popen [as 别名]
# 或者: from subprocess.Popen import map [as 别名]
def submit(self, params):
tag = get_tag()
if tag != "dryrun" or params.dry_run:
p = Popen(["./prepare_submit.sh"])
assert not p.wait()
from multiprocessing import Pool
p = Pool(4)
p.map(submit_job, [(job, tag, tag == "dryrun") for job in params.jobs])