def ids(args):
    """
    %prog ids fastafiles

    Generate the FASTA headers without the '>'.
    """
    p = OptionParser(ids.__doc__)
    p.add_option("--until", default=None,
             help="Truncate the name and description at words [default: %default]")
    p.add_option("--description", default=False, action="store_true",
             help="Generate a second column with description [default: %default]")
    p.set_outfile()

    opts, args = p.parse_args(args)

    if 1 < len(args):
        sys.exit(not p.print_help())

    until = opts.until
    fw = must_open(opts.outfile, "w")
    for row in must_open(args):
        if row[0] == ">":
            row = row[1:].rstrip()
            if until:
                row = row.split(until)[0]

            atoms = row.split(None, 1)
            if opts.description:
                outrow = "\t".join(atoms)
            else:
                outrow = atoms[0]
            print >> fw, outrow

    fw.close()
dataset/ETHPy150Open tanghaibao/jcvi/formats/fasta.py/ids/swapped operands of `<`