0

I've got code:

def get_choice(choices):
  choice2 = ""
  while choice2 not in choices:
      choice = input("Is this ur first use [%s]:" % ", ".join(choices))
      choice2 = choice.lower()
  return choice2

my_choice = get_choice(["yes", "no", "y", "n"])

It's working fine. Now, I would like to run this script automatically, so without any interaction from user. Is it possible, to set some default option for input, so after e.g. 5 seconds, it will just run(press enter/accept to go further in code) "default" option?

and secondary question.. Is there possibility to start input with something typed in it, and delayed option to press "enter"?

Maybe I shoudn't use input for that one, but is there better option to fit up both cases: with user, and without him?

KeroN
  • 1

0 Answers0