Created
July 26, 2015 20:39
-
-
Save Cabalist/3fde65e568bcf63689df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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