def bg_exec(args, log=None):

  def run(proc_args, log):
    if log is not None:
      out = open(log, 'w')
      subprocess.call(proc_args, stdout=out, stderr=out)
    else:
      subprocess.call(proc_args)
  multiprocessing.Process(target=run, args=(args, log)).start()
Run a command in a different process, optionally logging.
dataset/ETHPy150Open GoogleCloudPlatform/compute-hadoop-java-python/util.py/bg_exec