Python reading text files

From Augix' Wiki

Jump to: navigation, search
file = open("sample.txt", 'r')
 
while True:
    line = file.readline()
    if not line:
        break
    pass # do something

Reference: Reading text files

Personal tools