def keystop(delay=0): if os.name == 'posix': return len(select.select([sys.stdin],[],[],delay)[0]) else: return msvcrt.kbhit()