system exec ?

Martin Sjögren martin at strakt.com
Thu Jul 5 10:59:47 EDT 2001


On Thu, Jul 05, 2001 at 02:32:12PM +0200, Alex Martelli wrote:
> "alphaZeta" <NOSPAM.hnguyen421 at NOSPAM.hotmail.com> wrote in message
> news:9i1npl$160$1 at news.businessobjects.com...
> >
> > Thanks, I was also planning to use the readlines() method.
>     ...
> > > a = os.popen("ls -l").read()
> > >
> > > may be what you want (but you may also prefer to call .readlines()
> 
> That's good in most cases, just one further thing: if there
> is the possibility that the output of the command is vaster
> than will comfortably fit in memory, you may want to import
> xreadlines and rather than storing said output in your
> memory all at one loop over it line by line:

It is at these times you really wish you had lazy evaluation, like in
Haskell :) I miss Haskell...

Martin

-- 
Martin Sjögren
  martin at strakt.com              ICQ : 41245059
  Phone: +46 (0)31 405242        Cell: +46 (0)739 169191
  GPG key: http://www.strakt.com/~martin/gpg.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 248 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20010705/1a5d58a8/attachment.sig>


More information about the Python-list mailing list