开发者

How do I fill text-boxes in a gui application through command line?

I'm designing an NLP (Natural Language Processing) application in python and I want to use the following UNL (Universal Networking Language) EnConverter that is an executable gui - 3rd party - application and only works on windows (I don't have its source-code) :

How do I fill text-boxes in a gui application through command line?

So, what I want to know is how can I program a console application that calls this EnConverter and press the "Setting" button then manage to fill the text-boxes in the following image:

How do I fill text-boxes in a gui application through command line?

When I click the "Setting" button, the previous window shows up... I want my application to fill these text-boxes, then press "OK"... When pressing the "OK" button the application returns to the first window... The last thing for the application (my application) to do is clicking the "EnConvert" button in the first window... See the the first 开发者_开发百科image, please.

I know this is possible because my professor have done this job in Perl... And he refused to tell me how!!! I have researched the Internet but I got nothing!


You can use Win32::GuiTest. It can detect widgets, click buttons, write text to GUI etc.


You can use PyWinAuto. It can detect widgets, click buttons, write text to GUI etc.


The Windows Sendkey package looks like it should be ideal this kind of thing.

From the page:

In this example, SendKeys is used to type "Hello World!" in notepad.

import SendKeys
SendKeys.SendKeys("""
    {LWIN}
    {PAUSE .25}
    r
    Notepad.exe{ENTER}
    {PAUSE 1}
    Hello{SPACE}World!
    {PAUSE 1}
    %{F4}
    n
""")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜