system(cmd) should work in a cli environment on Mac OSX, Linux, and Windows
(cmd)
| 32 | raise OSError("command %r not found" % cmd) |
| 33 | |
| 34 | def system(cmd): |
| 35 | """ |
| 36 | system(cmd) should work in a cli environment on Mac OSX, Linux, |
| 37 | and Windows |
| 38 | """ |
| 39 | psi = System.Diagnostics.ProcessStartInfo(cmd) |
| 40 | psi.RedirectStandardOutput = True |
| 41 | psi.RedirectStandardError = True |
| 42 | psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal |
| 43 | psi.UseShellExecute = False |
| 44 | # Start up process: |
| 45 | reg = System.Diagnostics.Process.Start(psi) |
| 46 | |
| 47 | def getoutput(cmd): |
| 48 | """ |
no outgoing calls