On Tue, 02 Dec 2003 16:02:26 GMT, Kristofer Wouk
<kr*******@hotpop.com> wrote:
[...]
import os
os.popen('command > file')
This is a little confusing. Do you intend the output from 'command'
to go to 'file' or to the pipe you just opened?
If you are opening a pipe (to be read as a file object) I would
suggest something like this:
import os
file = os.popen('cat makefile | grep pyuic')
file.readlines()
['\tpyuic ModelSelector.ui > ModelSelector.py\n']
If you are just executing a command and not needing to process any
output from the command (other than its completion status), I would
stick with the more general:
import os
status = os.system('command > file')
status
0
--Dave