def enable():
global old_tc
# set terminal attributes
new = termios.tcgetattr(sys.stdin.fileno())
if old_tc == None:
old_tc = new[:]
new[3] = new[3] & ~termios.ECHO
new[3] = new[3] & ~termios.ICANON
termios.tcsetattr(sys.stdin.fileno(), termios.TCSADRAIN, new)
del new
评论列表
文章目录