I want the loop to end if the forward slash key is pressed, but the script continues without stopping.
while kb.is_pressed('/') == False:
for digit1 in range(startingDigit,10):
for digit2 in range(0,10):
for digit3 in range(0,10):
for digit4 in range(0,10):
code = (str(digit1)+str(digit2)+str(digit3)+str(digit4))
print(code)
kb.write(code)
kb.send('enter') #entering the code
time.sleep(0.5)
for i in range(0,5): #removing the last attempt, ready to start again
kb.send('backspace')