I use python 2.6 and have read many links about removing new line from 'print' but cannot find example of usage together with formating using modulo sign (%). In my program I am trying to write in a loop line of calculated data but each line data comes from different calculations:
while loop ... calulating value1 and value2 print ('%10d %10s') % (value1, value2) [1] ... calulating value3 and value4 print ('%7s %15d') % (value3, value4) [2] print #this is where newline should come from
So I would like to get:
value1 value2 value3 value4 value5 value6 value7 value8 ...
Basically this approach keeps readability of my program (each real line has over 20 calculated positions). The opposite way would be to concatenate all data into one, long string but readability could be lost.
Is it possible to remove newline using "print () % ()" syntax as in [1] and [2] ?