473,287 Members | 3,240 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

How python writes text into another windows application

Hi,

I am trying to write a simple program that reads data from a source file
(Excel sheet, XML file or text file) and then write the data into
another application by pasting the data into the applications fields,
and jumps from one field to another by writing \t tab.

My question is, how do I write the data into another application fields.
My target application is the TNT consignment manager. I asked TNT for
their API to make my life easier but they refused to release it :(. I
have a software that uses the same way I am looking after to fill in
application fields, it is the QuickAddress. Any idea how to achieve that?

Thanks

Meitham
Oct 29 '07 #1
3 1415
Le Mon, 29 Oct 2007 21:53:47 +0000, Meitham a écritÂ*:
Hi,

I am trying to write a simple program that reads data from a source file
(Excel sheet, XML file or text file) and then write the data into
another application by pasting the data into the applications fields,
and jumps from one field to another by writing \t tab.

My question is, how do I write the data into another application fields.
My target application is the TNT consignment manager. I asked TNT for
their API to make my life easier but they refused to release it :(. I
have a software that uses the same way I am looking after to fill in
application fields, it is the QuickAddress. Any idea how to achieve
that?

Thanks

Meitham
If you run Windows, try with pywinauto, it should have the tools you need
to control an external application via its gui.
http://sourceforge.net/projects/pywinauto

--
Laurent POINTAL - la*************@laposte.net
Oct 30 '07 #2
Meitham wrote:
My question is, how do I write the data into another
application fields. My target application is the TNT
consignment manager. I asked TNT for their API to make my life
easier but they refused to release it :(.
You know what the word "market" means? Just tell TNT, that it
seems they don't need you as a customer and so you will change
to another parcel service.

I had the very same situation with a regional parcel service a
few years ago, you won't believe how quick they were in
providing me with API information, in the prospect of loosing a
valuable customer (the fact that you want to automatize the
process suggests, that you have a lot of stuff to be delivered).

If they still don't bite, just show them a calculation, that it's
cheaper for you, to choose another parcel service that might
cost more, but you can save that money with the automatized data
entry.

Of course it's possible to send keypresses, mouse moves/clicks
and other messages to another application, but then you _MUST_
make sure, that no other application or a user interferes in the
process, and if an update of the software changes the interface
you have to reimplement the stuff from grounds up.

Wolfgang Draxinger
--
E-Mail address works, Jabber: he******@jabber.org, ICQ: 134682867

Oct 30 '07 #3
Thank you all for your kind answers.
I was going to use just shell.SendKeys("fu bar"), but as your answers
suggested pywinauto is a ready framework that covers all I need.

I wanted to play some politics with TNT, but I'm new in the company and
my manager won't listen :).

Meitham

Wolfgang Draxinger wrote:
Meitham wrote:
>My question is, how do I write the data into another
application fields. My target application is the TNT
consignment manager. I asked TNT for their API to make my life
easier but they refused to release it :(.

You know what the word "market" means? Just tell TNT, that it
seems they don't need you as a customer and so you will change
to another parcel service.

I had the very same situation with a regional parcel service a
few years ago, you won't believe how quick they were in
providing me with API information, in the prospect of loosing a
valuable customer (the fact that you want to automatize the
process suggests, that you have a lot of stuff to be delivered).

If they still don't bite, just show them a calculation, that it's
cheaper for you, to choose another parcel service that might
cost more, but you can save that money with the automatized data
entry.

Of course it's possible to send keypresses, mouse moves/clicks
and other messages to another application, but then you _MUST_
make sure, that no other application or a user interferes in the
process, and if an update of the software changes the interface
you have to reimplement the stuff from grounds up.

Wolfgang Draxinger
Nov 1 '07 #4

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

Similar topics

5
by: Zunbeltz Izaola | last post by:
Hi! I am planning a program and I need some advice about what tool to use. Basically my program will deal with a object A. A is a list like object with same attributtes and a list of objects...
5
by: Will | last post by:
Is there multi-media support in Python? So I can... 1 - play video in all the standard formats... windows & Mac? 2 - play flash files 3 - Power Point 4 - Standard graphic formats 5 - Sound in...
10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
19
by: dcrespo | last post by:
Hi all... Is there a way to print a PDF file directly from Python without having Acrobat installed? I know about ReportLab. It's a python module that lets you create almost any PDF document, but I...
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
267
by: Xah Lee | last post by:
Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's blog written in 2006-02-10 at...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.