我正在学习 autohotkey 和 python。我在 ahk 中编写了这个脚本(并且它有效!),它在 pokerstars 客户端中自动连接表格(使用 tableninja)--
^q::
Loop
{
Send q
Sleep 500
Send {PgUp}
Sleep 500
Send w
Sleep 60000
}
return
我想将它转换成 python——你能告诉我我可以使用哪些模块来完成这个吗?
python 脚本需要做的是(循环时)输入一个字母(在已经打开的记事本上),向下两行,输入另一个字母,然后等待一分钟,然后重新开始。
我在想——
import module to auto-type letters
import module that works as timer
def function
type letter q
enter
enter
def function
type letter w
def function
sleep
while True
function
function
function
我正在自学如何编码。我还没有达到关于 python 模块的那部分。谢谢!
最佳答案
假设你在 Windows 上工作(不要认为 AHK 可以在其他任何东西上运行),你应该查看 sendkeys .它将使发送击键变得小菜一碟。如果你想要更强大的东西,看看 pywinauto
快捷方式部分,看pyhook
关于python - 将 ahk 转换为 python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6556226/