2007/9/13, Jan Kundrát <[EMAIL PROTECTED]>: > treba (n)curses nebo slang. Netusim, jak jsou na tom s podporou win32.
Na woknech bych to udelal v principu takhle: def text_menu(default): print '1 - do A' print '2 - do B' print '3 - do C' print '--------------' print 'Your choice: ', orgtime = datetime.datetime.now() choice = None while datetime.datetime.now()<(orgtime+datetime.timedelta(seconds=10)) and (choice==None): if msvcrt.kbhit(): ch = msvcrt.getch() if ch in ['1','2','3']: choice = ch else: winsound.MessageBeep(winsound.MB_ICONEXCLAMATION) else: time.sleep(0.1) if choice: return choice else: return default Ovsem ekvivalenty kbhit() a getch() jsem na prvni pohled v dokumentaci neobjevil ;) Ondrej _______________________________________________ Python mailing list Python@py.cz http://www.py.cz/mailman/listinfo/python