def getoutput(cmd):
 psi = System.Diagnostics.ProcessStartInfo(cmd)
 psi.RedirectStandardOutput = True
 psi.RedirectStandardError = True
 psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
 psi.UseShellExecute = False
 reg = System.Diagnostics.Process.Start(psi)
 myOutput = reg.StandardOutput
 output = myOutput.ReadToEnd()
 myError = reg.StandardError
 error = myError.ReadToEnd()
 return output

def getoutput ( cmd ) : psi = System . Diagnostics . ProcessStartInfo ( cmd ) psi . RedirectStandardOutput = True psi . RedirectStandardError = True psi . WindowStyle = System . Diagnostics . ProcessWindowStyle . Normal psi . UseShellExecute = False reg = System . Diagnostics . Process . Start ( psi ) myOutput = reg . StandardOutput output = myOutput . ReadToEnd ( ) myError = reg . StandardError error = myError . ReadToEnd ( ) return output
return output of executing cmd in a shell .