Created
May 27, 2021 09:11
-
-
Save nikomatsakis/aa87dd60b673e49e39ffcdb0737b36fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/python | |
# coding=utf8 | |
import sys | |
file_objs = [sys.stdin] | |
prefix = "│ ├─┐─┘" | |
for file_obj in file_objs: | |
while True: | |
line = file_obj.readline() | |
output_list = [] | |
for c in line: | |
if c in prefix: | |
output_list.append(' ') | |
else: | |
output_list.append(c) | |
output_line = "".join(output_list) | |
if not output_line.isspace(): | |
sys.stdout.write(output_line) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment