Tag Archives: python memory error

How to Fix Python reading large local file memory error

Because want to read from the Dianping.com to climb down some data, so in the case of a bit big files caused jupyter directly blocked when reading, there are memory errors.
So how do you solve this problem?After some exploration, the shopkeeper finally found a solution. First, he wrote the solution code:

with open('The file you want to read.', 'r',encoding='utf-8') as f:
    for line in f:
        res = line
        print(res)