我用pynput制作了一个keylistener程序,将按下的键附加到我保存在pickle文件中的列表中,但是当我加载文件时输出不同
import pynput
from pynput.keyboard import Key,Controller
import pickle
keyboard = Controller()
with open("hahahahhahah", 'rb') as f:
l = pickle.load(f)
print(type(l[1]))
#outputs:^<class 'pynput.keyboard._xorg.KeyCode'>
print(l)
#^outputs:['d', 's', 'a', 'f', 's', 'd', 'f',]
print(l[2])
#^outputs:'a'
keyboard.press(l[1])
keyboard.release(l[1])
keyboard.press(l[1])
keyboard.release(l[1])
keyboard.press(l[1])
keyboard.release(l[1])
keyboard.press(l[1])
keyboard.release(l[1])
keyboard.press(l[1])
keyboard.release(l[1])
当我希望它输出 s 5 次时,这只是输出 # 5 次