File read ReadLines () method in Python __python

Source: Internet
Author: User
Yesterday with ReadLines read a file, run a good will automatically hang off, looking for a half-day also find no reason, and then asked the number of the list elements whether there is a limit. Why do I ask, because my file has 13g,775,149,707 line. Brother said no, this is odd strange, even if read in the list of memory will cost many times, but my memory is big enough, 1T AH. Brother memory consumption is too large, the program is not moving. Well, look at the exact cause when the task is over. Then we have to use readline, so that the memory is not consumed, a line read in.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.