>>> from standings import read_standings --iniin >>> lin = ['Arabia,2,1,0,1,3,3,3,1.5', ... 'Argentina,2,0,1,1,3,4,1,0.5', ... 'Australia,2,0,1,1,2,5,1,0.5', ... 'Denmark,2,0,1,1,1,3,1,0.5', ... 'France,2,2,0,0,7,2,6,3.0', ... 'Mexico,2,0,2,0,2,2,2,1.0', ... 'Poland,2,1,1,0,2,1,4,2.0', ... 'Tunisia,2,0,2,0,1,1,2,1.0'] --fiin >>> with open('stin.txt', 'w') as f: ... for a in lin: ... r = f.write(a+'\n') >>> L = read_standings('stin.txt') --iniout >>> L == [['Arabia', 2, 1, 0, 1, 3, 3, 3, 1.5], ... ['Argentina', 2, 0, 1, 1, 3, 4, 1, 0.5], ... ['Australia', 2, 0, 1, 1, 2, 5, 1, 0.5], ... ['Denmark', 2, 0, 1, 1, 1, 3, 1, 0.5], ... ['France', 2, 2, 0, 0, 7, 2, 6, 3.0], ... ['Mexico', 2, 0, 2, 0, 2, 2, 2, 1.0], ... ['Poland', 2, 1, 1, 0, 2, 1, 4, 2.0], ... ['Tunisia', 2, 0, 2, 0, 1, 1, 2, 1.0]] True --fiout