On 08-Aug-11 02:20, Kayode Odeyemi wrote:
    Either way, once you have the list of the keys you want to display,
    print them out once as column headings


My concern is how do I print them out as columns, since writer.writerows
is currently lining them out as rows (\n)
Is there a function available for me to do this or do I have to
construct the column structure myself, possibly leveraging
the tab character or just basically construct a while loop and append
spaces to each keys found?

I would suggest using the string format() method to lay out the columns as you want them. You could use tab, but if your data values vary much, you'll get inconsistent results (i.e., if one row's value goes past the next tab stop). You'll want to create your own for loop to iterate over the (possibly sorted) list of values, printing each row the way you want it.


Thanks

On Mon, Aug 8, 2011 at 9:41 AM, Steve Willoughby <[email protected]
<mailto:[email protected]>> wrote:

    Either way, once you have the list of the keys you want to display,
    print them out once as column headings




--
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde



--
Steve Willoughby / [email protected]
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to