有Python的程式库来模拟键盘动作吗? [英] Are there any libraries for Python to simulate keyboard action?

查看:90
本文介绍了有Python的程式库来模拟键盘动作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是我拥有此Python脚本来启动应用程序.启动应用程序后(在屏幕上显示GUI),我想使其停用.可以通过激活另一个窗口或最小化此应用程序,或按WindowsXP的显示桌面"键来手动完成此操作.

那么我有什么办法可以通过Python做到这一点?核心库或第三方库都可以.

谢谢!

解决方案

看看 SendKeys .它位于 pypi 中,因此您可以通过easy_install安装它.

The problem I have is that I have this Python script to launch a application. After the application is launched (the GUI is shown on screen), I want to make it de-activated. It can be done manually by activating another window, or minimizing this app, or pressing the Show Desktop key for WindowsXP.

So is there any way that I can do this by Python? Core or 3rd party library would be all ok.

Thanks!

解决方案

Take a look at SendKeys. It is in the pypi, so you can install it via easy_install.

这篇关于有Python的程式库来模拟键盘动作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆