
May 29th, 2004, 12:08 PM
|
 |
PHP ninja
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Formatting output
Is there anyway to neatly for mat output in python so that it lines up in columns??
Code:
def displayUserDetails(myforum):
"This function display the threads in the forum"
list = user.listDetails()
print "ID Occupation First Name Last Name"
for user in list:
print "%s %s %s %s"%(user[0],user[1],user[2],user[3])
The problem i'm having is that the output doesn't line up neatly depending on the the length of the user vars??
|