![]() | Input file format: two columns with numbers
0.1 1.4397 0.2 4.325 0.5 9.0 |
![]() | Read a line with x and y, transform y, write x and f(y):
for line in ifile: pair = line.split() x = float(pair[0]); y = float(pair[1]) fy = myfunc(y) # transform y value ofile.write('%g %12.5e\n' % (x,fy)) |