python - Most efficient way to open a file and read the lines? -


i've got this:

vlgastream = open('vlgachcwaves.txt', 'r+') vlgabuffer = vlgastream.readlines() vlgastream.close() 

but need way directly , efficiently read of lines file buffer?

iterating on file yields lines.

with open('vlgachcwaves.txt', 'r+') vlgastream:   line in vlgastream:     dosomethingwith(line) 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -