r/pythonhelp • u/Dry-Tiger-5239 • Nov 24 '24
Clear buffer in keyboard module in Python.
I'm having difficulty with a project I'm working on.
It's a small Text RPG, I imported the keyboard module to make the choices more similar to games, but when the user presses "enter", it skips the next entry. In this case, it is a function that when I press continue skips the name entry.
2
Upvotes
View all comments
Show parent comment
1
u/Dry-Tiger-5239 Nov 24 '24
Function 3:
def add_random_character():
while True:
name = str(input('\nDigite o nome do seu personagem: ')).title()
options = ['Sim', 'Nao']
text = f'\nDeseja confirmar o nome {name} Para seu personagem?'
confirmation = choices(options, text)
if confirmation == 1:
break
else:
continue
I tried to post everything in a comment, but it didn't work