7.0,我想知道这段代码做错了什么。我想让它无限循环并说vcmine start,但我已经尝试了一段时间,并尝试了一遍又一遍地发送代码,我只希望它将此代码打印到游戏中,这样我就不必在我的电脑上,但是我只能让它工作,只能说一次,请帮助我出了点问题,我不知道什么
from pynput.keyboard import Key, Controller
import time
keyboard = Controller ()
while True:
for char in "vcmine start":
keyboard.press(char)
keyboard.release(char)
time.sleep(0.03)
break
while True:
keyboard.press(key.enter)
keyboard.press(key.enter)
break
答案 0 :(得分:0)
我认为您想要的是:
from pynput.keyboard import Key, Controller
import time
keyboard = Controller ()
while True:
for char in "vcmine start":
keyboard.press(char)
keyboard.release(char)
time.sleep(0.03)
keyboard.press(key.enter)
time.sleep(0.03)
keyboard.press(key.enter)
time.sleep(0.03)