• python pyHook安装


    Hook安装

    哇 这东西可真费劲  主要有pyhook和pyhook3 两种 每个都要根据系统版本和python版本 分成各种小版本

    具体安装

    一.可以在cmd 中输入 pip install pyhook 来尝试自动在线安装 一般都不行

    二.可以去https://www.lfd.uci.edu/~gohlke/pythonlibs/ 中寻找自己喜欢的版本 

    然后下载

    在cmd中输入  pip install 将刚下载的*.whl文件拖入cmd 回车安装

    三.去https://sourceforge.net 里面搜 或许有自动安装包 不过python有注册表问题 安装中会报错 “没有找到该python版本” 复制下面的代码 保存为*.py 运行一下即好

    #
    # script to register Python 2.0 or later for use with win32all
    # and other extensions that require Python registry settings
    #
    # written by Joakim Loew for Secret Labs AB / PythonWare
    #
    # source:
    # http://www.pythonware.com/products/works/articles/regpy20.htm
    #
    # modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
     
    import sys
     
    from _winreg import *
     
    # tweak as necessary
    version = sys.version[:3]
    installpath = sys.prefix
     
    regpath = "SOFTWARE\Python\Pythoncore\%s\" % (version)
    installkey = "InstallPath"
    pythonkey = "PythonPath"
    pythonpath = "%s;%s\Lib\;%s\DLLs\" % (
        installpath, installpath, installpath
    )
     
    def RegisterPy():
        try:
            reg = OpenKey(HKEY_CURRENT_USER, regpath)
        except EnvironmentError as e:
            try:
                reg = CreateKey(HKEY_CURRENT_USER, regpath)
                SetValue(reg, installkey, REG_SZ, installpath)
                SetValue(reg, pythonkey, REG_SZ, pythonpath)
                CloseKey(reg)
            except:
                print "*** Unable to register!"
                return
            print "--- Python", version, "is now registered!"
            return
        if (QueryValue(reg, installkey) == installpath and
            QueryValue(reg, pythonkey) == pythonpath):
            CloseKey(reg)
            print "=== Python", version, "is already registered!"
            return
        CloseKey(reg)
        print "*** Unable to register!"
        print "*** You probably have another Python installation!"
     
    if __name__ == "__main__":
        RegisterPy()

    四.如果安装了多个版本python 在cmd时只会显示一种,这样pip安装不能指向所需要的版本,就需要更改环境变量Path,删掉不需要的版本即可,同时一定记得备份该数据。如果在更改完使用一些基本cmd命令无效,如ipconfig 需要在环境变量Path头部添加《c:windowssystem32;》 去掉书名号 

    ----

    最重要的是由于python3.7的hook 不能抓有中文标题的窗口 被我放弃了 

    ----

    python 安装了太多版本 charm里面都混乱了  在执行测试的时候一直报“ImportError: DLL load failed: 找不到指定的模块”  我一直以为安装的版本 不对或者没安装到位

    最后发现是charm里面并没有选对 合适python  ~.~

  • 相关阅读:
    12345679*81=?
    怪异,漂亮的几个数学恒等式(转)
    道路着色问题
    一组数学算式的欣赏(转)
    数学中奇妙的“金蝉脱壳”(转)
    数学中的分分合合(转)
    四方定理和卡布列克常数(转)
    简单的题目 有趣的现象
    Android学习笔记 第三节 基本控件学习
    Android学习笔记 第二节 HelloWorld程序
  • 原文地址:https://www.cnblogs.com/moshuixiong/p/11334446.html
Copyright © 2020-2023  润新知