PYTHON + EXCEL

2006-11-14 Thread dan84
I write my code : #inizializzazioni varie che tralascio #mi connetto al mio db mysql e recupero i dati che volgio inserire nel file excel conn = MySQLdb.connect(host = "XXX", port = XXX, user = "XXX", passwd = "XXX", db= "XXX") cursor = conn.cursor() cursor.execute("SELECT * FROM

Re: Python <=> Excel question

2005-10-04 Thread Magnus Lycka
Gerry Blais wrote: > Newbie questions: > > Suppose abc.xls has sheets a, b, c. > > How can I find, in Python, the sheet names? > > Given a sheet name, how can I export the sheet as a csv file? > > Finally, how can I, in Python, make a .txt version of a Word document? I think Google will help y

Re: Python <=> Excel question

2005-09-30 Thread riplin
> Suppose abc.xls has sheets a, b, c. > How can I find, in Python, the sheet names? > Given a sheet name, how can I export the sheet as a csv file? http://chicago.sourceforge.net/xlhtml/ This has options to output csv files, the list of sheets and many other things. Just execute this on the .xls

Re: Python <=> Excel question

2005-09-30 Thread Simon Brunning
On 9/30/05, Gerry Blais <[EMAIL PROTECTED]> wrote: > Finally, how can I, in Python, make a .txt version of a Word document? http://www.brunningonline.net/simon/blog/archives/001299.html -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mai

Python <=> Excel question

2005-09-30 Thread Gerry Blais
Newbie questions: Suppose abc.xls has sheets a, b, c. How can I find, in Python, the sheet names? Given a sheet name, how can I export the sheet as a csv file? Finally, how can I, in Python, make a .txt version of a Word document? Thanks, Gerry -- http://mail.python.org/mailman/listinfo/pyt

Re: python-Excel: Chinese Characters

2005-08-14 Thread John Machin
zxo102 wrote: > Hi there, > I am trying to put data including Chinese Characters into Excel > through python. But I got some problems. Here is my sample code: > > ## > # > import win32com.client > xlapp = win32com.client.DispatchEx("Excel.Applic

python-Excel: Chinese Characters

2005-08-14 Thread zxo102
Hi there, I am trying to put data including Chinese Characters into Excel through python. But I got some problems. Here is my sample code: ## # import win32com.client xlapp = win32com.client.DispatchEx("Excel.Application") xlbook = xlapp.Workboo

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-09 Thread Stuart Corrie
Did you use the excel macro recorder and look at the results to help you write that program? It seems to bear all the hallmarks of code generated that way. The macro recorder can be great, but almost always it is possible to speed up code by altering it afterwards, to condense and speed up the

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-04 Thread mimicico
I think you just need do: sh.Range(sh.Cells(4,1),sh.Cell­s(6,3)).Value = sh.Range(sh.Cells(1,1),sh.Cell­s(3,3)).Value -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-03 Thread zxo102
I found the solution for this. It needs to select a new location and paste from "sh". Thank you for your reading this. import win32com.client xl=win32com.client.Dispatch("E­xcel.Application") xl.Visible=1 wb = xl.Workbooks.Add( ) sh=wb.Worksheets(1) sh.Cells(1,1).Value = "Hello World!" sh.Cells(3,

Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-03 Thread zxo102
Hi there, I need your help for python <--> excel. I want to paste selected cells (range) to different location on the same sheet in Excel through python. I have tried it for a while but could not figure it out. Here is my sample code: import win32com.client xl=win32com.client.Di

Re: Python/Excel AddIn (was:Re: Does Python have a Template::Extract equivalent from Perl's CPAN)

2005-05-27 Thread [EMAIL PROTECTED]
CL, after you install py_win32 on windows you should look for a module called "excel*.py" under your ${PYTHONHOME} directory. They have a very basic COM Server Excel AddIn as an example. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/Excel AddIn (was:Re: Does Python have a Template::Extract equivalent from Perl's CPAN)

2005-05-27 Thread combinational.logic $ soc-ip.com
Thanks Paul! When I get a chance I'll mess around with Py + Excel as you have suggested . I was hoping not to have to deal with VBScript :) -- http://mail.python.org/mailman/listinfo/python-list

Python/Excel AddIn (was:Re: Does Python have a Template::Extract equivalent from Perl's CPAN)

2005-05-27 Thread Paul McNett
Please start a new thread when appropriate. combinational.logic $ soc-ip.com wrote: > Can you please elaborate on how to use Python for MS Excel AddIn > development? Is this easy to do? I would love to be able to create > custom extensions to Excel using python! IMHO Python is much better > than