def check_key(): if msvcrt is None: return False else: if msvcrt.kbhit(): q = ensure_unicode(msvcrt.getch()) return q return ""