I'm a Blessed https://pypi.python.org/pypi/blessed用户,最近,当我试图找出该内容时term.bold()
函数,我得到这个输出:\x1b[1m\x1b(B\x1b[m
我明白什么\x1b[1m
and \x1b[m
做什么,但是做什么\x1b(B
做?我尝试打印它,但它似乎根本没有做任何事情。
提前致谢!
控制序列\x1b(B
选择默认字符集 ASCII。看XTerm 控制序列 http://invisible-island.net/xterm/ctlseqs/ctlseqs.html:
ESC ( C Designate G0 Character Set (ISO 2022, VT100).
Final character C for designating 94-character sets. In this
list, 0 , A and B apply to VT100 and up, the remainder to
VT220 and up. The VT220 character sets, together with the
Portuguese character set are activated by the National
Replacement Character controls. The A is a special case,
since it is also activated by the VT300-control for British
Latin-1 separately from the National Replacement Character
controls.
...
C = B -> United States (USASCII).
提供这一点是为了防止终端设置为其他字符集,例如,画线 https://vt100.net/docs/vt102-ug/chapter5.html#T5-15. Blessed https://pypi.python.org/pypi/blessed可能正在检索此作为一部分\x1b(B\x1b[m
,例如,在
normal = tigetstr('sgr0')
进一步阅读:
- 如何使用 VT100 获取颜色? http://invisible-island.net/ncurses/ncurses.faq.html#vt100_color
- VT100.net http://vt100.net/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)