On Wed, Feb 4, 2009 at 1:22 AM, Helmut Jarausch <jarau...@skynet.be> wrote:
> Hi,
>
> using e.g.
> import subprocess
> Package='app-arch/lzma-utils'
> EQ=subprocess.Popen(['/usr/bin/equery','depends',Package],stdout=subprocess.PIPE)
> EQ_output= EQ.communicate()[0]
>
> EQ_output is a string containing multiple lines.
>
> I'd prefer a file-like object, e.g. EQ_OUT
> so that I can loop over the lines of it like
>
> for line in EQ_OUT :
>  ...

Is there some reason that:

for line in EQ_OUT.splitlines():
    #...

Does not meet your needs?

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to