Use python to execute a windows program

Jerry Hill malaclypse2 at gmail.com
Fri Sep 11 15:09:20 EDT 2009


On Fri, Sep 11, 2009 at 12:46 PM, Doran, Harold <HDoran at air.org> wrote:
> I am working with this now. I'm toying with the examples to test out a
> few things and learn how this works. I've made some modifications such
> that I have the following working (below). This does nothing more than
> open a program.
>
> I have commented out the portion
>
> #app.AM.MenuSelect("File->Open Database")
>
> When it is uncommented, the program fails. However, when I tinker with
> this MenuSelect() for, say, Notepad, this presents no problem and
> behaves as expected. For example, the following works with notepad:
>
> app.Notepad.MenuSelect("Help->Help Topics")
>
> At the risk of sounding too silly, how do I know what to place after
> app.??.MenuSelect? I've tried this with a few programs and the name I
> use in place of ?? Doesn't seem to work.

I'm not very familiar with pywinauto myself, but a quick look through
the docs says that the application looks for a window or dialog with a
"similar" name to what you put there.  So, what does the title bar of
the window opened by AM.exe say?  You should use a name that is
"similar" to the title of the window you're trying to control.

-- 
Jerry



More information about the Python-list mailing list