python remove readlines not include newline code example Example: readlines replace \n with open(filename) as f: mylist = f.read().splitlines()