import keyboard
def print_pressed_keys(e):
if e.event_type=="down":
print(e, e.event_type, e.name)
keyboard.hook(print_pressed_keys)
keyboard.wait()
Traceback (most recent call last):
File "C:\Users\User\Desktop\keyboard.py", line 1, in <module>
import keyboard
File "C:\Users\User\Desktop\keyboard.py", line 9, in <module>
keyboard.hook(print_pressed_keys)
AttributeError: module 'keyboard' has no attribute 'hook'