Mercurial > repos > fubar > tool_factory_2
comparison test-data/tf2_test_runme.py @ 0:c34063ab3735 draft
Initial commit of code in iuc github repository
author | fubar |
---|---|
date | Thu, 01 Jan 2015 21:58:00 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c34063ab3735 |
---|---|
1 ### bog standard argparse for 3 possible comma separated lists | |
2 ## followed by some silly reverse each row code provided as an example | |
3 ## you're supposed to replace it with your great code.. | |
4 import sys | |
5 import argparse | |
6 import copy | |
7 argp=argparse.ArgumentParser() | |
8 argp.add_argument('--INNAMES',default=None) | |
9 argp.add_argument('--INPATHS',default=None) | |
10 argp.add_argument('--OUTPATH',default=None) | |
11 argp.add_argument('--additional_parameters',default=[],action="append") | |
12 argp.add_argument('otherargs', nargs=argparse.REMAINDER) | |
13 args = argp.parse_args() | |
14 fout = open(args.OUTPATH,'w') | |
15 sins = open(args.INPATHS.split(',')[0]).readlines() | |
16 for i,sin in enumerate(sins): | |
17 row = sin.strip().split('\t') | |
18 rrow = copy.copy(row) | |
19 lrow = len(row) | |
20 if (lrow > 1): | |
21 for j in range(lrow): | |
22 rrow[j] = row[lrow-j-1] | |
23 fout.write('\t'.join(rrow)) | |
24 fout.write('\n') | |
25 fout.close() |