def run_program(program, args=None, **subprocess_kwargs):
 if (('shell' in subprocess_kwargs) and subprocess_kwargs['shell']):
  raise ProgramError('This function is only for non-shell programs, use run_shell_command() instead.')
 fullcmd = find_program(program)
 if (not fullcmd):
  raise ProgramError(('Program %s was not found' % program))
 fullcmd = ([fullcmd] + (args or []))
 for stream in ['stdin', 'stdout', 'stderr']:
  subprocess_kwargs.setdefault(stream, subprocess.PIPE)
 subprocess_kwargs = alter_subprocess_kwargs_by_platform(**subprocess_kwargs)
 return subprocess.Popen(fullcmd, **subprocess_kwargs)

def run_program ( program , args = None , ** subprocess_kwargs ) : if ( ( 'shell' in subprocess_kwargs ) and subprocess_kwargs [ 'shell' ] ) : raise ProgramError ( 'This function is only for non-shell programs, use run_shell_command() instead.' ) fullcmd = find_program ( program ) if ( not fullcmd ) : raise ProgramError ( ( 'Program %s was not found' % program ) ) fullcmd = ( [ fullcmd ] + ( args or [ ] ) ) for stream in [ 'stdin' , 'stdout' , 'stderr' ] : subprocess_kwargs . setdefault ( stream , subprocess . PIPE ) subprocess_kwargs = alter_subprocess_kwargs_by_platform ( ** subprocess_kwargs ) return subprocess . Popen ( fullcmd , ** subprocess_kwargs )
run program in a separate process .