I need help with my code right here. This will obviously be a very simplified version of my code and it only includes the parts that I have a problem with.
import keyboard
print("something something...")
keyboard.wait("enter")
while True:
player1 = input("Enter name -- ")
if not player1.isalpha():
print("Invalid reply!")
continue
break
Still, here is the link to my full code if that could be useful to you in helping me with my problem: https://pastebin.com/mDsAdawr
Whenever my code reaches the part keyboard.wait("enter") the input function right after it runs in the background and stores all of the keypresses that I make. For example, if the user types in Hello123 and then presses enter, the input function will assign "Hello123" to the variable player1 thus displaying the error message, even though the user didn't even mean to input that for the variable.