hbutils.encoding.ansi¶
- Overview:
Functions for ansi escaping and unescapes. See ANSI escape code - Wikipedia.
ansi_unescape¶
-
hbutils.encoding.ansi.
ansi_unescape
(string: str) → str[source]¶ - Overview:
Unescape ansi string. See ANSI escape code - Wikipedia.
- Parameters:
string – Original output string.
- Return unescaped:
Unescaped ansi string.
- Examples::
>>> from hbutils.encoding import ansi_unescape >>> ansi_unescape("[1;31mHello") 'Hello' >>> ansi_unescape("[2;37;41mWorld") 'World'