How to call a procedure in exe file

Terry Reedy tjreedy at
Mon Sep 23 09:12:32 EDT 2002

"A" <printers at> wrote in message
news:mailman.1032767369.29784.python-list at
> from Python but is it possible to call a procedure in an exe
> I have a program that downloads some files( that was written in
> we bought that  program compiled already in exe).
> I must start the program and then push a button that runs a
procedure for downloading.
> And I must do it al the time when I want to download a file. So I am
thinking about
> downloading automatically from Python. I can start the program
> with os.startfile but I do know know how to start the procedure
> that is started when I push
> the button for downloading.(I may possiblly find address of the

Lots of IFs -- in my order of preference:

IF the program has a command-line option to download without a 'button
push' (ie, --download <list of files>), use that.  IF is doesn't, ask
that such be added if you can.  (Utility programs ought to have such
options just so they can be used programmatically without operator
present, just like you want to do.)

IF you can start download with keys instead of just mouse, and if
program takes keypresses through generic standard input functions
(like C getchar()) rather than specific getkey function, start it at
the other end of a pipe.

IF program has COM interface, get PythonWin stuff and use that.

IF you can find (or write or modify open-source code to make) a
mouse-click simulator program thats responds to dynamic input via
stdin (rather than only responding to prewritten script read as
startup), use that.

Terry J. Reedy

More information about the Python-list mailing list