Python for document acquisition Solution

Source: Internet
Author: User

This article describes the actual operation steps of the python for computer language in practical applications. If you are interested in python, you can use our article to learn more about the actual application solutions. The following is a detailed introduction of the article.

I have never written a python script before, so I found a simple tutorial and did it again. These two days I tested the performance of the mysql archive engine, so I used python to insert 1 billion pieces of data into the archive table. python is roughly written as follows:

 
 
  1. for i in range(0,100000000)  
  2. insert into ….  
  3.  

After the execution of the results, the system crashed and asked for "Viagra". At last, when the script was executed again, the for in range ended the memory and searched for it in the python for document, obtain the following information:

 
 
  1. range([start], stop[, step])   
  2. This is a versatile function to create lists 
    containing arithmetic progressions. It is most often 
    used in for loops.  
  3.  

Originally, python for directly created a list containing 1 billion integers, 1 billion * 4 byte = 40 000 0000 byte = 400 GB, and then the system memory was consumed directly.

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.