Op 11/12/2022 om 12:32 schreef Stefan Ram:
r...@zedat.fu-berlin.de (Stefan Ram) writes:
Curses is not portable IIRC. A more portable means would
be to use tkinter with the "bind" function to bind keys.
import tkinter

text = tkinter.Text()
text.pack()
text.bind\
( "<y>",
   lambda event:
   text.insert
   ( tkinter.END, "Y\nFormatting drive C:\n...\n" )or "break" )
text.insert( tkinter.END, "Format drive C:?\n" )
text.focus()

tkinter.mainloop()

   Not allowing users to edit their keypresses before confirming
   them with [Return]. What could possibly go wrong?

Nothing that can't go wrong otherwise. It is my experience that
when a [Return] is needed, people just type in a two key combination.
They don't type one key, then check, then type [Return].

So in practice the same things go wrong, either way.

--
Antoon Pardon.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to