Reputation: 47316
How to format printing stmt in python?
print"---------------------------------"
print"client:mount-point:logfile:status"
print"---------------------------------"
print clientname,mntpt,logfile,status
Currently it prints something like this :
---------------------------------
client:mount-point:logfile:status
---------------------------------
client01 : /some/path/mnt/1007/1 : /export/something/laks/specs_dir/log/client1/gc.log:running
How to make this output better?. Any suggestions
Upvotes: 0
Views: 479
Reputation: 86502
If you're trying to format a table, consider using other software for table formatting.
As an example, you can produce HTML with the print
statements and view the table with a browser. Another option is to generate csv
data to be viewed using a spreadsheet program.
Upvotes: 0
Reputation: 73600
Take a look at string formatting : http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
Upvotes: 1