Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'processing.': 0.03; 'width': 0.07; 'csv': 0.09; 'files.': 0.10; 'am,': 0.14; 'wrote:': 0.14; '>>in': 0.16; 'columns': 0.16; 'csv,': 0.16; 'subject:import': 0.16; 'mon,': 0.17; 'importing': 0.19; 'received:74.125.82.44': 0.19; 'received:mail-ww0-f44.google.com': 0.19; 'header:In-Reply-To:1': 0.21; 'column': 0.22; 'module,': 0.23; "doesn't": 0.25; 'subject:data': 0.26; 'message- id:@mail.gmail.com': 0.28; 'manually': 0.29; 'subject:How': 0.30; 'represents': 0.32; 'file.': 0.32; 'to:addr:python-list': 0.33; 'file': 0.34; 'using': 0.35; 'data.': 0.37; 'received:google.com': 0.37; 'change': 0.37; 'despite': 0.37; 'extremely': 0.37; 'received:74.125.82': 0.38; 'received:74.125': 0.38; 'subject:from': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'plain': 0.40; 'format': 0.40; 'according': 0.63; 'simple,': 0.65; '3200': 0.91; 'kind.': 0.91; 'open,': 0.91 MIME-Version: 1.0 In-Reply-To: <0604E20B5F6F2F4784C9C8C71C5DD4DD2E348A0CA3@EMARC112VS01.exchad.jpmchase.net> References: <9ad94241-e281-4325-9c0d-23547ad0b9b9@glegroupsg2000goo.googlegroups.com> <85318329-5bc8-4474-a54e-4e7ff53cd304@k3g2000prl.googlegroups.com> <0604E20B5F6F2F4784C9C8C71C5DD4DD2E348A0CA3@EMARC112VS01.exchad.jpmchase.net> Date: Mon, 6 Jun 2011 11:43:53 -0700 Subject: Re: How to import data from MySQL db into excel sheet From: Benjamin Kaplan To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-Junkmail-Status: score=10/49, host=mpv1.tis.cwru.edu X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A020209.4DED1FEA.0083,ss=1,fgs=0, ip=74.125.82.44, so=2010-12-23 16:51:53, dmn=2009-09-10 00:05:08, mode=single engine X-Junkmail-IWF: false X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307385843 news.xs4all.nl 49038 [::ffff:82.94.164.166]:54491 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7105 On Mon, Jun 6, 2011 at 9:35 AM, Prasad, Ramit 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.