Re: trying to read from pipe

anthony baxter (anthony.baxter@aaii.oz.au)
Thu, 01 Sep 1994 15:42:29 +1000

Mike Tibbs wrote:
> >>> from posix import *
> >>> fd = popen('ls', 'r')
> >>> s = read(fd, 4)
> Traceback (innermost last):
> File "<stdin>", line 1
> TypeError: bad argument list (format '(ii)')
>
> >>> close(fd)
> Traceback (innermost last):
> File "<stdin>", line 1
> TypeError: bad argument list (format 'i')

I've always used:
>>> fd=posix.popen('ls','r')
>>> s=fd.read(4)
>>> fd.close()

Anthony

-- 
anthony baxter @ /\/\||    / australian artificial intelligence institute, \ 
email: anthony@aaii.oz.au ||===============================================|| 
phone: +613 663 7922       \ level 6, 171 latrobe st, melbourne aust. 3000 / 
          That's SULTAN Vile Betrayer to you - Iago, Aladdin.