Python 2.7 - Write and read a list from file,my_list = [line.rstrip('\n') for line in f]