python-install pyuserinput module

Description of use: You need to use python to control the mouse and keyboard, and handle clicks and events!

First, let's sort out an idea:

Install pyuserinput

Step 1: Install pyHook

 URL: https://www.lfd.uci.edu/~gohlke/pythonlibs/

Here cp37 is my python version, version 3.7. My computer is a 64-bit system, and I must download the corresponding version. If I make a mistake, I should report an error. I have no problem with the corresponding download!

The download is complete - in PyCharm (python editor)

 Install the software we downloaded just now!

pip install D:\文件名字

When installing, it will automatically open and download the pywin32,12M file package, after the normal installation is complete!

We came to PyCharm-Settings-Project-Interpreter search-pyuserinput

 If you search out the file, the installation error

Choose a lower version of pyuserinput to download and try!

If another problem occurs, an error will be reported: Non-zero exit code (2)

Then please lower your pip version, try lowering the version, if it doesn’t work, then lower the version, and cycle test!

## example == followed by version number
python -m pip install pip==20.2.4

If all the above are normal, then start a simple test:

from pymouse import PyMouse
from pykeyboard import PyKeyboard

m = PyMouse()  # 创建鼠标实例
k = PyKeyboard()  # 创建键盘实例

m_x_position, m_y_position = m.position()
print(m_x_position, m_y_position)#打印鼠标位置

 At this point, we can start using python to do what the mouse and keyboard can do, and let the code replace it!

Guess you like

Origin blog.csdn.net/munchmills/article/details/127160650