Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Is there a way to push data into Microsoft Excel & Word from Python ?

Reply
Thread Tools

Is there a way to push data into Microsoft Excel & Word from Python ?

 
 
The Night Blogger
Guest
Posts: n/a
 
      12-16-2006
Is there a way to push data to Microsoft Excel & Word from a Python
Application

Is this a cross platform feature ? I'll need to push data on MS Windows &
Mac OS X ....


 
Reply With Quote
 
 
 
 
Caleb Hattingh
Guest
Posts: n/a
 
      12-16-2006

The Night Blogger wrote:
> Is there a way to push data to Microsoft Excel & Word from a Python
> Application


On Windows, it's easy after you install the win32 extensions. For
example, for
python:

import win32com.client
xl = win32com.client.Dispatch('Excel.Application')

after which you can operate on "xl" (almost) as if you were coding in
VBA. I have driven Excel from python a /lot/, and it works well.
Paul Boddie has written a great tutorial---which includes some Outlook
examples, btw---over here:

http://thor.prohosting.com/~pboddie/Python/COM.html

> Is this a cross platform feature ? I'll need to push data on MS Windows &
> Mac OS X ....


I have zero OSX experience, but 30s of googling brings up this:

http://appscript.sourceforge.net/

Kevin Walzer mentions on this mailing list entry:

http://mail.python.org/pipermail/pyt...st/400255.html

that Excel provides reasonably good support for applescript, but again,
I have no idea whether these things work; I'm just doing your googling
for you.

Assuming applescript works, you may want to write a thin wrapper over
the combination of the win32 COM interface and the applescript
interface that at least lets your business logic sit in one place. The
wrapper can use the right API depending on the platform it finds itself
on at runtime.

Regards
Caleb

 
Reply With Quote
 
 
 
 
John Machin
Guest
Posts: n/a
 
      12-16-2006

The Night Blogger wrote:
> Is there a way to push data to Microsoft Excel & Word from a Python
> Application
>
> Is this a cross platform feature ? I'll need to push data on MS Windows &
> Mac OS X ....


Depends on what you mean by "push". If you wish to create Excel files
but not update existing ones, you might consider pyExcelerator. It is
pure Python and therefore will run on any platform that Python will.
http://cheeseshop.python.org/pypi/pyExcelerator/

Cheers,
John

 
Reply With Quote
 
Paul Boddie
Guest
Posts: n/a
 
      12-17-2006
Caleb Hattingh wrote:
> Paul Boddie has written a great tutorial---which includes some Outlook
> examples, btw---over here:
>
> http://thor.prohosting.com/~pboddie/Python/COM.html


Thanks for the kind words! The most current location of this tutorial
is here:

http://www.boddie.org.uk/python/COM.html

I don't use Windows any more, but I suppose it's still relevant to at
least some people.

Paul

 
Reply With Quote
 
Caleb Hattingh
Guest
Posts: n/a
 
      12-21-2006
Hi Paul

> Thanks for the kind words!


No, thank _you_ for taking the time to write such a useful document.

regards
Caleb

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are "Array#push" and "pop" not "push!" and "pop!"? samppi Ruby 27 12-05-2007 07:24 AM
J2ME program for Push Email, IM, Push RSS on your mobile phone! XyZaa Java 0 07-19-2007 03:00 PM
Is there a way to push data into Ical from Python ? The Night Blogger Python 5 12-18-2006 08:30 PM
Is there a way to push data into Microsoft Oulook from Python ? The Night Blogger Python 1 12-17-2006 03:20 AM
microsoft.public.dotnet.faqs,microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vb Charles A. Lackman ASP .Net 1 12-08-2004 07:08 PM



Advertisments