def blockindent(s, indent='\t', initial='\t'):
    """Block-indents a string by adding the given indent to the start of every line.
    The default indent is 1 tab.  You can also provide an initial indent to
    apply at the beginning of the string (defaults to 1 tab).
    """
    if initial:
        s = initial + s
    s = s.replace('\n', '\n'+indent)
    return s