How to get into python by pressing a key without pressing the enter key?

I saw a solution here , but I don't want to wait for a key press. I want the last key pressed.

+3
source share
2 answers

Your question might help you, as @ S.Lott mentioned: Detecting keys pressed on keys in python

I write, although I give advice: do not worry about it. What program are you trying to create? Programs running on the terminal usually do not have an interface in which keystrokes for live keystrokes are interesting. Not now. For programs running in the terminal, you should worry about the useful User Interfase command line using optparse or other modules.

, . , ? Theuser , , "", - - 80 ?. Tkinter , Python + Windows, yoru .

, : , , , WEB-. , , , - 1989 .

, ncurses. , .

+4

http://code.activestate.com/recipes/134892/

,

ps ooops, , ... , btw?

:

:

from msvcrt import getch

, ... ( ) : http://www.daniweb.com/forums/thread115282.html

0

Source: https://habr.com/ru/post/1781490/


All Articles