Re: Difference between Popen and open() for reading a file

2010-04-30 Thread Aahz
In article , J wrote: > >Say I had a file, foo.txt that I wanted to read from, only one time >and only read. > >So what's the difference between this: > >mylist = Popen(["cat","foo.txt"], stdout=PIPE).communicate()[0].splitlines() > >Is there a reason why you would not use subprocess.Popen for th

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread J
On Thu, Apr 22, 2010 at 15:18, Dave Angel wrote: > The same difference as between handing the paper boy three bucks, versus > flying to London to open an account, making a deposit, going to a branch in > Sydney and asking for a bank check, then flying back home and taking the > paper boy with you

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread Dave Angel
J wrote: I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference between this: mylist = Popen(["cat","foo.txt"], stdout=PIPE).comm

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread MRAB
J wrote: I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference between this: mylist = Popen(["cat","foo.txt"], stdout=PIPE).commun

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread Chris Rebert
On Thu, Apr 22, 2010 at 11:28 AM, J wrote: > I was reading something from a code review a little while ago and saw > something that's got my curiosity up... > > Say I had a file, foo.txt that I wanted to read from, only one time > and only read. > > So what's the difference between this: > > mylis

Difference between Popen and open() for reading a file

2010-04-22 Thread J
I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference between this: mylist = Popen(["cat","foo.txt"], stdout=PIPE).communicate()[0].