faqts : Computers : Programming : Languages : Python : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 14 people (36%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

Is there a way to get input not echoed to the screen in Python, as in the non-standard functions kbhit() and getch() in C and C++?

Jul 23rd, 2000 23:45
unknown unknown, Bjorn Pettersen


import msvcrt
while not msvcrt.kbhit():
   #do something
c = msvcrt.getch()
assuming you're on windows, of course...