nick34992
1/21/2017 - 11:03 PM

Python: Open and Iterate through Text File #python

Python: Open and Iterate through Text File #python

#!/usr/bin/python3
'''
FileName: iterate_txt_file.py
Author: nick3499
Created: Sat Jan 21 2017
Python Version: 3.5

e.g. filename = 'instructions.txt'
'''

file = open(filename, "r")

for line in file:
    print(line)

file.close()