Bio.Dev.Op

Biology, Code & Computers

What not to do in Python when working with Big Data

Please do not do this If you're developing software that is working with big data files:

f = open("really_big_fucking_file.dat")
lines = f.readlines()
for line in lines:
    do_something(line)
f.close()

Please do this:

with open("really_big_fucking_file.dat") as f:
    for line in f:
        do_something(line)

Comments