>>> from fair import stands >>> lf = ['joan pera;2.2;cheese\n', ... 'marta perez;2.3;leather\n', ... 'georgina pi;1.8;jewels\n', ... 'joana morales;1.9;sausages\n', ... 'pere girbau;2.1;cakes\n', ... 'maria marti;2.3;dresses\n', ... 'jordi pons;2;jewels\n', ... 'narcis punti;1.9;leather\n'] >>> with open('stands.txt', 'w') as f: ... f.writelines(lf) >>> dic = {'cheese': 'food', 'leather': 'handicraft', ... 'sausages': 'food', 'cakes': 'food', ... 'dresses': 'handicraft', 'jewels': 'handicraft'} >>> stands('stands.txt', 'food.txt', 'craft.txt', dic, 5.1, 6.1) >>> with open('food.txt', 'r') as f: ... a = f.read() >>> with open('craft.txt', 'r') as g: ... b = g.read() >>> a, b ('joan pera\njoana morales\n', 'marta perez\ngeorgina pi\njordi pons\n')