如何使用python curses库将光标绘制为垂直条?
您需要执行此操作:
https://stackoverflow.com/a/17100535/9590859
curses库中没有用于原始控制序列的API,只需运行:
def run_control_sequence(sequence):
os.write(sys.stdout.fileno(), bytes(sequence, 'utf-8'))
run_control_sequence('\x1b[\x36 q')
此解决方案取决于终端。上面的控制序列适用于xterm。