python-3.x - 使用 python 脚本安装程序
问题描述
我正在尝试编写一个在 Windows 上下载和安装 notepad++ 的脚本,不幸的是,我找不到自动安装 notepad++ 的方法。我用了:
from pywinauto.application import Application
fsv =Application(backend="uia").start("notepad++.exe")
fsv.InstallDialog.NextButton.wait('ready', timeout=30).click_input()
fsv.InstallDialog.IAgreeRadioButton.wait('ready', timeout=30).click_input()
fsv.InstallDialog.Edit.Wait('ready', timeout=30).type_keys(os.getcwd() + "\Notepad++", with_spaces=True)
fsv.InstallDialog.InstallButton.wait('ready', timeout=30).click_input()
fsv.InstallDialog.FinishButton.wait('ready', timeout=30).click_input()
解决方案
推荐阅读
- javascript - 为什么我无法访问 setTimeout 中的事件值?
- node.js - 如何在特定视频秒内将背景音乐添加到视频文件中?在 node-fluent-ffmpeg
- c# - 如何将变量读取到数组中?
- python - 在给定点获取纹理颜色的问题
- ruby - 模拟 ctrl+c 按下 / 发送 'SIGINT' 到子进程
- c++ - 让我对 Postman 的 HTTP 响应缺少什么(使用 C++ boost::asio)
- operators - Verilog >> 运算符的语义应用于网络
- java - 是否可以在 Java 中创建一个函数来检测传递给它的任何参数是否为空?(可变参数)
- javascript - 如何改进此元音计数器功能以提高效率?
- python - 使用 python 创建一个机器人以在上午 9:00、上午 10:00 等单击下载按钮