# get contents of file as a list, one line per element data = open('/path/to/file').readlines()