How python writes text into another windows application

M

Meitham

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
 
L

Laurent Pointal

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
 
W

Wolfgang Draxinger

Meitham said:
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
 
M

Meitham

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top