Skip to content

Instantly share code, notes, and snippets.

@Cabalist
Created July 26, 2015 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cabalist/3fde65e568bcf63689df to your computer and use it in GitHub Desktop.
Save Cabalist/3fde65e568bcf63689df to your computer and use it in GitHub Desktop.
from __future__ import print_function
with open("/Users/work/man_ls.txt") as a_man_page:
for each_line in a_man_page:
skip_next = False
underline = False
for each_char in each_line:
if skip_next and underline:
print(each_char, end="")
skip_next = False
undeline = False
continue
if skip_next and not underline:
skip_next = False
continue
if each_char == "\x08":
skip_next = True
continue
if each_char == "_":
underline = True
continue
print(each_char, end="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment