方法一:
首先安装pyperclip库:pip install pyperclip
import pyperclip
pyperclip.copy('规定')#将规定复制到系统剪贴板#
pyperclip.paste()
方法二:
首先需要安装PyUserInput和pyautogui
pip install pyautogui
pip install PyUserInput
import pyautogui
from pykeyboard import PyKeyboard
from pymouse import PyMouse
k = PyKeyboard()
m = PyMouse()
#点击Ctrl+shift切换到中文输入法
k.press_key(k.control_key)
k.press_key(k.shift_key)
k.release_key(k.shift_key)
k.release_key(k.control_key)
#每个字母输入时间间隔为0.25s,输入规定,并点击键盘1,将规定输入在输入框位置
pyautogui.typewrite(['g', 'u', 'i', 'd', 'i', 'n', 'g', '1'], 0.25)