Writing to an error log, I used following construct:
It then occured to me that I called the print function 4 times and that it would probably be more performant to use
which indeed produced the same output:
Unfortunately, informative error messages tend to be longer and using the single print option quickly ran into code readability problems, due to extremely long progam statements. So I decided to break up the line in different chunks, terminating each previous line with the Enter key.
Which much to my (initial) surprise produced - double spacing!
Therefore I removed the newline character from my statements to finally settled on this:
Giving the single spaced result.
Is this a correct way of producing single spaced multilines?
_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
Code:
#separate print statements
print "first line\n";
print "second line\n";
print "third line\n";
print "\n";
Code:
#Single print - single line
print "first line\nsecond line\nthirdline \n\n";
Code:
first line
second line
third line
Code:
#Single print - multiline - Enter
print "first line\n
second line\n
third line\n
\n";
Code:
first line
second line
third line
Code:
#Single print - multiline - Enter
print "first line
second line
third line
\n";
Is this a correct way of producing single spaced multilines?
_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]