Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的代码,它将打开窗口并将密钥发送到窗口,但某些屏幕无法正常工作
from pywinauto.application import * import time app=Application.Start("Application.exe") app.window_(title="Application") time.sleep(1) app.top_window_().TypeKeys("{TAB 2}")
top_window_()
要检查,请运行:
app.top_window_().DrawOutline() #Highlight the window
2.窗口可以不活动,输入前设置焦点:
window = app.top_window_() window.SetFocus() window.TypeKeys("{TAB 2}")
3.更多,您可能需要点击窗口。
window.Click() window.TypeKeys("{TAB 2}")