list into table ?

This is the place for queries that don't fit in any of the other categories.

list into table ?

Postby sanjayanammu » Sat May 04, 2013 8:22 am

hi, can anyone help me in how to create a python program to convert as below

from list

Code: Select all
list=[5730,3440,"Collection of visa",1366675200000,1366675200000,
"Hi please collect visa from visa office at ASC at 14:15 in room 2024
also please bring your passport and residence document."]


into table

Code: Select all
SERIAL_No               TITLE                   START_ DATE-TIME               END_ DATE-TIME                      NOTE

 1                      Collection of visa           1366675200000                 1366675200000              Hi please collect visa from
                                                                                                              visa office at ASC at 14:15 in
                                                                                                              room 2024 also please bring
                                                                                                              your passport and residence
                                                                                                              document.


sanjayanammu
 
Posts: 3
Joined: Tue Apr 09, 2013 7:46 am

Re: list into table ?

Postby setrofim » Sat May 04, 2013 9:47 am

What do you mean by "table"? What are you planning on doing with it? If you just want column-aligned output printed to the screen, your can use ljust(), rjust() or ceter() string methods to fromat values into columns of appropriate width. In order for this to work properly, you'll first need to work out what the max widths are for each column by looking at all of the values for that column. Also, see this section of the tutorial.
setrofim
 
Posts: 288
Joined: Mon Mar 04, 2013 7:52 pm

Re: list into table ?

Postby sanjayanammu » Mon May 06, 2013 1:59 pm

setrofim wrote:What do you mean by "table"? What are you planning on doing with it? If you just want column-aligned output printed to the screen, your can use ljust(), rjust() or ceter() string methods to fromat values into columns of appropriate width. In order for this to work properly, you'll first need to work out what the max widths are for each column by looking at all of the values for that column. Also, see this section of the tutorial.


ok thank you for your reply i will try as your said and see
sanjayanammu
 
Posts: 3
Joined: Tue Apr 09, 2013 7:46 am


Return to General Coding Help

Who is online

Users browsing this forum: snippsat, W3C [Linkcheck] and 4 guests