473,804 Members | 4,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 ....
Dec 16 '06 #1
4 2762

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('Exce l.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

Dec 16 '06 #2

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

Dec 16 '06 #3
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

Dec 17 '06 #4
Hi Paul
Thanks for the kind words!
No, thank _you_ for taking the time to write such a useful document.

regards
Caleb

Dec 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3701
by: Ksenia Marasanova | last post by:
Hi, I have a little problem with encoding. Was hoping maybe anyone can help me to solve it. There is some amount of data in a database (PG) that must be inserted into Excel sheet and emailed. Nothing special, everything works. Except that non-ascii characters are not displayed properly. The data is stored as XML into a text field. When I use pgsql it's displayed good in the terminal. Now I run my script and print data
6
23210
by: Will | last post by:
Hi, Sorry to be a pest... But I can figure this out. I'm pushing to a stack. then I need to check to see if the word is a palindrome. Is the code below correct? if so, how can I check the entire word?
0
3733
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank text boxes how do I stop this and how would I code it to redirect to a thank you page. All with out the help of a web server this has to br ran from the desktop and with in IE with a local directory. Pleas help I am stuck. here is the code! ...
4
2502
by: Lewis Edward Moten III | last post by:
I have a file that users can download through a web page protected by forms authentication: Download.aspx?ID=45 and within that file ... FileInfo fileToDownload = new FileInfo(fileName);
6
2411
by: Mark Rae | last post by:
Hi, My client has asked me to provide a "quick and dirty" way to export the contents of a DataGrid to both Excel for analysis and Word for editing and printing, so I'm investigating client-side automation. N.B. the environment is a totally enclosed intranet, all the client machines have WinXP, IE6 and Office Pro 2003 with all the latest SPs, and the IE security settings are sufficient to allow the Local Intranet Zone to instantiate...
7
7819
by: Vanessa | last post by:
hi Everyone, I have two questions on exporting data to Excel using ASP (w/o converting formatted excel file into web page and then plug in the dynamic data): 1. Can we export data into different sheets at Excel? 2. Can we do graph at export? Thanks!!
7
9035
by: vbnetdev | last post by:
My boss wants this done in a day. I would be happy with a week! Anyway, I have a dataset filled with data and need to populate an MS word chart with it when writing a report. Any tutorials or suggestions would be great. Sample data at http://www.kjmsolutions.com/sample.txt
0
14428
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may be greater than 255 characters. 2. I have an access database. I link (not import) to the contents of the excel spreadsheet. In the design view in access, Column A has the data type "memo".
6
2740
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in the event handler for a form button. Is there other ways to accomplish this? I looked at some on the web and usergroups, but was confused as to the functioning. BTW my datagrid is enclosed in a <div></divfor ease of scrolling if that would...
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.