Python нажмите клавишу
if keyboard.is_pressed('q'): # if key 'q' is pressed
print('You Pressed A Key!')
break # finishing the loop
crizzhd
if keyboard.is_pressed('q'): # if key 'q' is pressed
print('You Pressed A Key!')
break # finishing the loop
try:
while True:
do_something()
except KeyboardInterrupt:
pass
#pip install keyboard
import keyboard
while True:
# Do your stuff
if keyboard.is_pressed("q"):
# Key was pressed
break