所以我的代码遇到了一些问题,它被识别
keyboard.type()
为类型而不是字符串,我有所有必要的导入。我怎样才能解决这个问题?
with open("words.txt") as fp:
line = fp.readline()
cnt = 1
while line:
print(line)
line = fp.readline()
cnt += 1
exploit(line)
def exploit(keyboard):
time.sleep(2)
keyboard.type(line)
错误:
File "C:\Users\User\Desktop\ref.py", line 63, in start
exploit(line)
File "C:\Users\User\Desktop\ref.py", line 46, in exploit
keyboard.type("hello")
AttributeError: 'str' object has no attribute 'type'
键盘模块(https://pypi.org/project/pynput/)被导入