shell command output

William Park parkw at better.net
Mon May 21 03:03:08 EDT 2001


On Sun, May 20, 2001 at 10:06:58PM -0700, Sorin Gherman wrote:
> The only solution I can think of is to use a temp file:
> 
> os.system("diff f1 f2 > tmp")
> tmpfile = open("tmp")
> tmpcontent = tmpfile.readlines()
> for line in tmpcontent:
>    print line
> 
> Is there any solution to avoid the temp file?

popen() in 'os' module.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>.
8 CPU, (Slackware) Linux, Python, LaTeX, Vim, Mutt, Sc.




More information about the Python-list mailing list