You should try the input function. I use it all the time. It does require the user to hit enter but that is pretty typical of that kind of interface. So I would write a loop like
while True: answer = input("Please answer the question (y/n):") if answer == 'y': break Chris On Sun, Dec 11, 2022 at 11:03 AM Stefan Ram <r...@zedat.fu-berlin.de> wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: > >import tkinter > > This two-liner allows to answer with just one keypress ([Y]/[N]) here. > > import tkinter.messagebox > tkinter.messagebox.askyesno( "Question", "Format harddisk?" ) > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list