Рубрики
Без рубрики

Проверьте, есть ли в строке коды побега ANSI

от FunctorFlow Import F (‘ansi-ESC’, ‘\ U001b [4Municorn \ U001b [0M’) Print (r) # true … Tagged with Repit, Python, Functorflow.

from functorflow import f

r = f('ansi-esc', '\u001B[4mUnicorn\u001B[0m')
print(r) # True

Оригинал: “https://dev.to/samandar/check-if-a-string-has-ansi-escape-codes-4bgo”