code: def capture(command, input=None, cwd=None, shell=False, raiseOnError=False):
  		
  		
  		# Attempt to execute the child process
  		proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd, shell=shell, universal_newlines=True)
  		(stdout, stderr) = proc.communicate(input)
  		
  		# If the child process failed and we were asked to raise an exception, do so
  		if raiseOnError == True and proc.returncode != 0:
  			raise Exception(
  				'child process ' + str(command) +
  				' failed with exit code ' + str(proc.returncode) +
  				'\nstdout: "' + stdout + '"' +
  				'\nstderr: "' + stderr + '"'
  			)
  		
  		return CommandOutput(proc.returncode, stdout, stderr)
docs: Executes a child process and captures its output