为什么安装

  pyHook包:为Windows中的全局鼠标和键盘事件提供回调。 Python应用程序为用户输入事件注册事件处理程序,例如鼠标左键,鼠标左键,键盘键等

  先要实时获取系统的鼠标位置或者键盘输入必备之神器!

python2安装

  安装及使用见:Python 键盘鼠标监听

 

python3安装

  由于官方还不支持python3,已有的python3版本出现【TypeError: MouseSwitch() missing 8 required positional arguments: 'msg', 'x', 'y', 'data', 'time', 'hwnd', and 'window_name'】这个错误,采用下列方法

  见:使用Python 3.5/3.6监听本机任意窗口中的按键操作

效果

  本例是实时获取鼠标坐标

  

python3.5安装pyHook,解决【TypeError: MouseSwitch() missing 8 required positional arguments: 'msg', 'x', 'y', 'data', 'time', 'hwnd', and 'window_name'】这个错误!的更多相关文章

  1. typeerror: __init__() missing 2 required positional arguments: 'inputs' and 'outputs'

    1 问题描述 使用下边这条命令去检查 TensorFlow Object Detection API是否正确安装: python object_detection\builders\model_bui ...

  2. 解决TypeError: __init__() missing 1 required positional argument: 'on_delete'

    试用Djiango的时候发现执行mange.py makemigrations 和 migrate是会报错,少位置参数on_delete,查了一下是因为指定外键的方式不对,改一下就OK了. 代码如下: ...

  3. Django问题 TypeError: __init__() missing 1 required positional argument: 'on_delete'

    问题:在执行python manage.py makemigrations learning_logs时,系统会报错,提示:TypeError: __init__() missing 1 requir ...

  4. TypeError: save() missing 1 required positional argument: 'self'

    RT,在创建模型对象的时候,提示TypeError: save() missing 1 required positional argument: 'self' 解决办法:在创建模型对象的时候需要加上 ...

  5. 【Selenium+Python Webdriver】报错之:TypeError: user_login() missing 1 required positional argument: 'self'

    先贴一下源码: base.py文件如下: from selenium import webdriver class Page(object): ''' 页面基础类,用于所有页面的继承 ''' rb_u ...

  6. 执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument: 'on_delete'

    在执行python manage.py makemigrations时报错: TypeError: __init__() missing 1 required positional argument: ...

  7. Django :执行 python manage.py makemigrations 时报错 TypeError: __init__() missing 1 required positional argument: 'on_delete'

    原因 执行命令 python manage.py makemigrations 报错 TypeError: __init__() missing 1 required positional argum ...

  8. Django关联数据库时报错TypeError: __init__() missing 1 required positional argument: 'on_delete'

    sgrade = models.ForeignKey("Grades",) 执行python manage.py makemigrations后出现TypeError: __ini ...

  9. python进行数据库迁移的时候显示(TypeError: __init__() missing 1 required positional argument: 'on_delete')

    进行数据库迁移的时候,显示  TypeError: __init__() missing 1 required positional argument: 'on_delete' 图示: 出现原因: 在 ...

随机推荐

  1. 做直线不要使用hr

    需要横线.竖线时不要使用hr标签来做,容易出问题,可以使用高度或宽度为1px并加上背景色的div.p代替.

  2. spark-shell启动报错:Yarn application has already ended! It might have been killed or unable to launch application master

    spark-shell不支持yarn cluster,以yarn client方式启动 spark-shell --master=yarn --deploy-mode=client 启动日志,错误信息 ...

  3. mysql中多个left join子查询写法以及别名用法

    不多说 直接上语句   SELECT     a.id,     a.thumbNail,     a. NAME,     a.marketPrice,     a.memberPrice,     ...

  4. WPF获得全局窗体句柄,并响应全局键盘事件

    场景 wpf窗体运行后,只能捕获当前Active窗体的按键事件,如果要监听windows全局事件,并对当前窗口事件响应. 第一步:导入Winows API public class Win32 { [ ...

  5. swift 之 函数

    swift的函数跟脚本语言有很多神似之处. 如果有一天用swift开发服务器 ,很期待哇(一切皆有可能,毕竟人家说要跑在Linux上),

  6. 微信公众号开发(十二)OAuth2.0网页授权

    OAuth允许用户提供一个令牌,而不是用户名和密码来访问它们存放在特定服务器上的数据,每一个令牌授权一个特定的网站在特定时段内访问特定的资源. 授权过程如下: 1.引导用户进入授权页面同意授权,获取c ...

  7. 老大哥在看着你!我国部署超2000万个AI监控系统

    原文:Big brother is watching you! China installs 'the world's most advanced video surveillance system' ...

  8. THINKPHP中几个缓存的问题

    1.字段缓存. THINKPHP是默认开启字段缓存的.如果关闭了APPDEBUG(即在index.php中设置了这样一句话:define("APP_DEBUG","FAL ...

  9. A. 拼音魔法

    A. 拼音魔法 Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: 256 megabyt ...

  10. css媒体查询:响应式网站

    css媒体查询:响应式网站 媒体查询 包含了一个媒体类型和至少一个使用如宽度.高度和颜色等媒体属性来限制样式表范围的表达式.CSS3加入的媒体查询使得无需修改内容便可以使样式应用于某些特定的设备范围. ...