How to import data from MySQL db into excel sheet

Benjamin Kaplan benjamin.kaplan at case.edu
Mon Jun 6 14:43:53 EDT 2011


On Mon, Jun 6, 2011 at 9:35 AM, Prasad, Ramit <ramit.prasad at jpmchase.com> wrote:
>> Currently i am importing the Database into CSV file using csv module,
>>in csv file i need to change the column width according the size of
>>the data. i need to set different column width for different columns
>>pleas let me know how to achieve this
>
> If you are using xlwt:
> sheet.col(9).width = 3200
>
> I am not sure exactly what unit the 3200 represents so I just adjust this manually to be a size that works for me.
>
>
> Ramit
>
>

xlwt is a package for editing Excel files. CSV, despite being a format
that Excel can open, is not an Excel file. A CSV is to spreadsheets
what plain text is to word processing. It's an extremely simple, easy
to use format programaticfally but it doesn't support any formattting
of any kind.



More information about the Python-list mailing list