[Tutor] Perl to Python code migration

Jeff Shannon jeff@ccvcorp.com
Thu, 05 Sep 2002 19:24:27 -0700


Sean 'Shaleh' Perry wrote:

> On Thursday 05 September 2002 11:01, Jeff Shannon wrote:
> >
> > Try using the split() string method.
> >
>
> and you just violated his request that the whole file not be read in at once.

I didn't see any explicit specification along those lines...  though perhaps it
was implied by the Perl idiom.  I don't know Perl, so I'd miss that.

Given that restriction, then the best solution probably would be to read in small
chunks of the file (possibly using xreadlines() if it's broken into lines) until
the delimiter is found, and accumulating those chunks manually.

Jeff Shannon
Technician/Programmer
Credit International