io.py
author Dmitriy Morozov <dmitriy@mrzv.org>
Thu, 05 May 2011 11:11:04 -0700
changeset 14 9e82d4394fc3
parent 7 cbb51ef4dd6d
child 15 30a851aa0675
permissions -rw-r--r--
Added wireframe option to spheres

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 = []