[Tutor] raw_input()

Benno Lang transmogribenno at gmail.com
Tue Mar 16 01:27:13 CET 2010


On 16 March 2010 08:28, Steven D'Aprano <steve at pearwood.info> wrote:
> On Tue, 16 Mar 2010 10:22:55 am kumar s wrote:
>> thanks Benno.
>>
>> supplying 3.6 GB file is over-kill for the script.
>
> Then supply a smaller file.
>
>
>> This is the reason I chose to input lines on fly.
>
> I don't understand what you are trying to say.

I think he thinks that python is going to read the whole 3.6GB of data
into memory in one hit, rather than using a small amount of memory to
process it line by line. But "for line in datafile" in your code above
uses a generator, right? So I don't think it's a problem - correct me
if I'm wrong.

Thanks,
benno.


More information about the Tutor mailing list