source:
trunk/essentials/dev-lang/python/Lib/commands.py@
3393
| Last change on this file since 3393 was 3225, checked in by , 19 years ago | |
|---|---|
| File size: 2.2 KB | |
| Line | |
|---|---|
| 1 | """Execute shell commands via os.popen() and return status, output. |
| 2 | |
| 3 | Interface summary: |
| 4 | |
| 5 | import commands |
| 6 | |
| 7 | outtext = commands.getoutput(cmd) |
| 8 | (exitstatus, outtext) = commands.getstatusoutput(cmd) |
| 9 | outtext = commands.getstatus(file) # returns output of "ls -ld file" |
| 10 | |
| 11 | A trailing newline is removed from the output string. |
