######################################## Save as readfile_1.py - works and removes blank lines ############################################ import os f = open('C:\\temp\\one.txt', "r") for line in f: print(line.strip()) f.close() ####################################### the below is the same with explicit "readline" But does the same thing ####################################### import os f = open('C:\\temp\\one.txt', "r") for line in f.readlines(): print(line.strip()) f.close()