code: def append(args):
      
      p = OptionParser(append.__doc__)
      p.set_sep()
      p.set_outfile()
      opts, args = p.parse_args(args)
  
      nargs = len(args)
      if nargs not in (1, 2):
          sys.exit(not p.print_help())
  
      csvfile = args[0]
      tag = args[1] if nargs == 2 else csvfile
      fp = must_open(csvfile)
      fw = must_open(opts.outfile, "w")
      for row in fp:
          row = row.rstrip("\r\n")
          row = opts.sep.join((row, tag))
          print(row, file=fw)
docs: %prog append csvfile [tag]
  
      Append a column with fixed value. If tag is missing then just append the
      filename.