R
Rajarshi Guha
Hi
I have a file containing 168092 lines (each line a single word) and when
I use
for line in f:
s = s + line
it takes for ages to read it all in - so long in fact that it makes the
program unusable. Is there any way to do something like C's fread in
Python so that I can just slurp in 1.7MB of data at one go, rather than
reading line by line?
Thanks,
Rajarshi
I have a file containing 168092 lines (each line a single word) and when
I use
for line in f:
s = s + line
it takes for ages to read it all in - so long in fact that it makes the
program unusable. Is there any way to do something like C's fread in
Python so that I can just slurp in 1.7MB of data at one go, rather than
reading line by line?
Thanks,
Rajarshi