python - 如何使用 PyWinAuto 在后台发送密钥?
问题描述
这是我当前的代码:
from pywinauto.application import Application
from pywinauto.keyboard import send_keys
from time import sleep
app = Application(backend="uia").start('notepad.exe')
textsend = input("What do you want to send? ")
def send(text):
app.send_keys(text, with_spaces = True, with_newlines = True, with_tabs = True)
sleep(2)
while True:
send(f"{textsend}\n")
input("")
它工作正常,但问题是,我必须让记事本保持专注。有没有办法在记事本最小化时发送密钥?
解决方案
推荐阅读
- python - NLTK 正则表达式,如何编写特定的语法?
- python - (如何)我可以使用 requests.OAuth2Session 发送(准备好的)请求吗?
- excel - 在单独的查找表中查找与多个条件匹配的行
- laravel - 当我只有用户名时如何获取用户头像?
- r - 从回归线方程中删除不需要的字符
- c# - 如何使用实体框架在 Xamarin 中查询 Sqlite?
- r - 如何在 R 中使用 glmer (lme4) 修复“奇异拟合”?
- javascript - 如何创建动态字母 ID 系统?
- verilog - 通过引用传递到 System Verilog 模块或接口
- python - 使用 if-elif 语句将 Null 值添加到 pandas 数据帧