def to_segwizard(segs, target, header=True, coltype=LIGOTimeGPS):
<EOL>if isinstance(target, string_types):<EOL><INDENT>with open(target, '<STR_LIT:w>') as fobj:<EOL><INDENT>return to_segwizard(segs, fobj, header=header, coltype=coltype)<EOL><DEDENT><DEDENT>if header:<EOL><INDENT>print('<STR_LIT>', file=target)<EOL><DEDENT>for i, seg in enumerate(segs):<EOL><INDENT>a = coltype(seg[<NUM_LIT:0>])<EOL>b = coltype(seg[<NUM_LIT:1>])<EOL>c = float(b - a)<EOL>print(<EOL>'<STR_LIT:\t>'.join(map(str, (i, a, b, c))),<EOL>file=target,<EOL>)<EOL><DEDENT>
Write the given `SegmentList` to a file in SegWizard format.

    Parameters
    ----------
    segs : :class:`~gwpy.segments.SegmentList`
        The list of segments to write.

    target : `file`, `str`
        An open file, or file path, to which to write.

    header : `bool`, optional
        Print a column header into the file, default: `True`.

    coltype : `type`, optional
        The numerical type in which to cast times before printing.

    Notes
    -----
    This method is adapted from original code written by Kipp Cannon and
    distributed under GPLv3.