I have a python script that looks like this:
print "Header 1"
print "\t Sub-header 1"
print "\t\t (*) Sentence 1 begins here and goes on... and ends here."
The sentences are being printed in a loop with the similar format, and it gives an output like this in the terminal:
Header 1
Sub-header 1
(*) Sentence 1 begins here and goes on...
and ends here.
(*) Sentence 2 begins here and goes on ...
and ends here.
.
.
.
Is there any way I can make the formatting as follows? :
Header 1
Sub-header 1
(*) Sentence 1 begins here and goes on...
and ends here.
(*) Sentence 2 begins here and goes on ...
and ends here.
.
.
.
print ('Text_1= %-20s | Text_2 = %0s | Text_3 = %6s\n') %('Here', 'Here_2', 'Here_3')to print on screen. Does this help you? (run it)