When drawing edges as pipes use the selected color
def line_blocks(filename, size = 1): block = [] with open(filename) as f: for line in f: if not line.strip() or line.startswith('#'): continue block.append(line) if len(block) == size: yield block block = []