I use Python to collect data from a web service. The data itself is a list that will be presented to users. I managed it that it printed as:
( 1) Example of strings ( 2) Example 4 ( 3) Another Example ( 4) Another Example 2
I use rjust (2) for numbers. However, if the lines are very long, the print will be similar. The gap width is the terminal length (rxvt, gnome terminal):
( 1) Example of a very very very very long string and that doesn't look fine ( 2) Example of indented long line that is very very long, example line ( 3) Another Example ( 4) Another Example of a very very long string and whatever here is
But I want to print as:
( 1) Example of a very very very very long string and that doesn't look fine ( 2) Example of indented long line that is very very long, example line ( 3) Another Example ( 4) Another Example of a very very long string and whatever here is
Any ideas how to print the lines as above without breaking the lines manually?
source share