Stephen.Wu wrote:
tmp=file.read() (very huge file)
if targetStr in tmp:
    print "find it"
else:
    print "not find"
file.close()

I checked if file.read() is huge to some extend, it doesn't work, but
could any give me some certain information on this prolbem?


Python has no specific limit on string size other than memory size and perhaps 32 bit address space and so on. However, if your file size is even a fraction of that size, you should not attempt to read it all into memory at once. Is there not a way to process your file in batches of a reasonable size?

Gary Herron


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to