You're not reading the file content:
my_file_contents = f.read()
See the docs for further infos
You could, without calling read()
or readlines()
loop over your file object:
f = open('goodlines.txt')
for line in f:
print(line)
If you want a list out of it (without \n
as you asked)
my_list = [line.rstrip('\n') for line in f]