Python - File Reading and Writing Strategies
Which method is best to read a very large text file without using too much memory?
with open('file.txt', 'r') as f:
Which method is best to read a very large text file without using too much memory?
with open('file.txt', 'r') as f:
for line in f: reads one line at a time, keeping memory low.for line in f: -> Option C15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions