我有一个问题,我找不到任何帮助。我的想法是我无法导入 pynput。我做了 pip install ,这就是它所显示的:
> Traceback (most recent call last):
File "sb.py", line 1, in <module>
from pynput.keyboard import Key, Controller
ImportError: No module named pynput.keyboard
我再次尝试 pip install pynput 并显示
已满足要求
这是代码,我不知道它是否有帮助,但你去:
from pynput.keyboard import Key, Controller
def game():
keyboard = Controller()
if key.press():
s = Sound()
s.read("Cymatics - Guitar Chord Loop 2 - 128 BPM Dmaj")
s.play()
print "Welcome to soundboard"
print "You will see a list of sound names, just write the name of it"
print "If you want to stop it type stop"
print "Type start"
start = input()
if start.lower() == "start":
while True:
game()
else:
print "Ups, try again.."
提前致谢