#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging import subprocess import multiprocessing import sys log = logging.getLogger() def main(args=None): logging.basicConfig() pool = multiprocessing.Pool() r = pool.apply_async(run_with, ('foobar', 1, 2)) r.get() def run_with(configfile, angle, current): try: dW1 = run_dcon() except: log.exception('ops') raise def run_dcon(): with open('/dev/null', 'wb') as fh: subprocess.check_call(['dcon'], stdout=fh, stderr=fh) if __name__ == '__main__': main(sys.argv[1:])