>>> from solargen2 import solargen_sum --input-ini >>> inlines = [ ... 'gA;1-15;on;3.5;2.5;4.0;*;7.0;3.2;4.0', ... 'gA;2-16;off;0.0;0.2;0.0;*;0.3;*', ... 'gA;3-17;on;3.0;3.3;4.4;2.0;7.0;3.0;4.0;5.0', ... 'gB;3-11;on;2.3;3.5', ... 'gB;1-13;on;*;3.9', ... 'gC;1-18;on;*;3.6;4.0;7.0;4.5;3.0', ... 'gC;2-19;on;2.4;*;*;3.0;4.1', ... 'gC;2-18;off;0.0;0.0;0.2;0.3;0.0', ... 'gC;3-19;on;3.1;4.0;3.9;*;3.2', ... 'gB;2-11;on;4.1;4.1;4.0', ... 'gB;2-12;off;0.1;0.0;0.3', ... 'gB;3-13;on;3.2;2.0;4.3', ... ] --input-fi >>> with open('in.txt', 'w') as f: ... for lin in inlines: ... f.write(lin+'\n') 37 32 43 19 17 33 27 32 29 23 24 23 --output-ini >>> outlines_corr = [ ... 'gA;1-15;6;24.2', ... 'gA;3-17;8;31.7', ... 'gB;3-11;2;5.8', ... 'gB;1-13;1;3.9', ... 'gC;1-18;5;22.1', ... 'gC;2-19;3;9.5', ... 'gC;3-19;4;14.2', ... 'gB;2-11;3;12.2', ... 'gB;3-13;3;9.5', ... ] --output-fi >>> solargen_sum('in.txt', 'out.txt') >>> outlines = [] >>> with open('out.txt', 'r') as f: ... for lin in f: ... outlines.append(lin.strip()) >>> if outlines == outlines_corr: ... True ... else: ... print(outlines) ... print(outlines_corr) True >>> import os >>> os.remove('in.txt') >>> os.remove('out.txt')