def run_shell_command(cmdstr, **subprocess_kwargs):
 if (('shell' in subprocess_kwargs) and (not subprocess_kwargs['shell'])):
  raise ProgramError('The "shell" kwarg may be omitted, but if provided it must be True.')
 else:
  subprocess_kwargs['shell'] = True
 if ('executable' not in subprocess_kwargs):
  subprocess_kwargs['executable'] = os.getenv('SHELL')
 for stream in ['stdin', 'stdout', 'stderr']:
  subprocess_kwargs.setdefault(stream, subprocess.PIPE)
 subprocess_kwargs = alter_subprocess_kwargs_by_platform(**subprocess_kwargs)
 return subprocess.Popen(cmdstr, **subprocess_kwargs)

def run_shell_command ( cmdstr , ** subprocess_kwargs ) : if ( ( 'shell' in subprocess_kwargs ) and ( not subprocess_kwargs [ 'shell' ] ) ) : raise ProgramError ( 'The "shell" kwarg may be omitted, but if provided it must be True.' ) else : subprocess_kwargs [ 'shell' ] = True if ( 'executable' not in subprocess_kwargs ) : subprocess_kwargs [ 'executable' ] = os . getenv ( 'SHELL' ) for stream in [ 'stdin' , 'stdout' , 'stderr' ] : subprocess_kwargs . setdefault ( stream , subprocess . PIPE ) subprocess_kwargs = alter_subprocess_kwargs_by_platform ( ** subprocess_kwargs ) return subprocess . Popen ( cmdstr , ** subprocess_kwargs )
runs a single command in shell and returns the read stdout and stderr data .