Speed up loading and free memory...

GrelEns grelens at NOSPAMyahoo.NOTNEEDEDfr
Thu Mar 11 12:41:24 CET 2004

"Otto Krüse" <otto_kruse at hotmail.com> a écrit dans le message de news:
40503fab$0$77281$abc4f4c3 at news.wanadoo.nl...
> How do you access and read the .txt files? Could you give the commands
> you use?

for line in open(myfile, 'r'):
    # process line

BTW there were bugs, times are more about 2 minutes which is acceptable, but
still around 200mb of memory with objects while 170mo with tuples.

i've read posts about caching mecanism to not re-read same line of a file
again and again, or even to cache object to avoid their construction, can
someone point me out to a good tutorial or article on this ?


More information about the Python-list mailing list