'Write the output file'

def write_outfile(self, outdata, outname):

    if outname:
        print(('Writing    output    to    %s' % outname), file=sys.stderr)
        with open(outname, 'wb') as outfile:
            outfile.write(outdata)
    else:
        print('Writing    output    to    stdout', file=sys.stderr)
        sys.stdout.write(outdata)
