Roh*_*ada 10 python autohotkey
有没有办法从autohotkey发送一些参数到python.
使用Autohot键我从记事本中读取了一些数字并存储在变量中,现在我想将这个数字发送到python代码以进行一些计算.
我的Autohotkey代码是:
controlGetText, telphoneNumber, Edit1, Untitled - Notepad
Run Code Online (Sandbox Code Playgroud)
我想把它发送telphoneNumber到python文件.
有没有办法可以做到这一点?
我是否需要创建一个python的exe文件,然后从autohotkey调用?例如:
RunWait, C:\Button\button.exe telphoneNumber
Run Code Online (Sandbox Code Playgroud)
或者我需要从autohotkey运行命令提示符命令来运行python程序?就像是:
Run Cmd Python C:\Button\button.py telphoneNumber
Run Code Online (Sandbox Code Playgroud)
我不知道哪个是最好的方式,因为我是Autohotkey的新手.
任何建议将不胜感激.
编辑:
但是我成功通过使用来自autohotkey的run命令发送参数,该命令将从命令提示符执行python文件.
Run Cmd \k "Python C:\Button\button.py %telphoneNumber%"
Run Code Online (Sandbox Code Playgroud)
但是仍然想知道这是否是正确的解决方案,还是有其他解决方案?
您让它发挥作用的方式是实现您想要的目标的最简单、也可能是最好的方法。
应用程序之间的通信可以通过比您想象的更多的方法来完成,但只要它不必是实时的,您就可以使用参数调用您的程序,因为它既简单又可靠。
| 归档时间: |
|
| 查看次数: |
4900 次 |
| 最近记录: |