annotate pyrev_pos_test/pyrev_pos_test.python.txt @ 1:0183cad9d13b draft

planemo upload
author fubar
date Thu, 22 Feb 2024 10:48:01 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
0183cad9d13b planemo upload
fubar
parents:
diff changeset
1 #raw
0183cad9d13b planemo upload
fubar
parents:
diff changeset
2 ## reverse order of text by row
0183cad9d13b planemo upload
fubar
parents:
diff changeset
3 ## ToolFactory demonstration
0183cad9d13b planemo upload
fubar
parents:
diff changeset
4 ## positional parameters
0183cad9d13b planemo upload
fubar
parents:
diff changeset
5 import sys
0183cad9d13b planemo upload
fubar
parents:
diff changeset
6 inp = sys.argv[1]
0183cad9d13b planemo upload
fubar
parents:
diff changeset
7 outp = sys.argv[2]
0183cad9d13b planemo upload
fubar
parents:
diff changeset
8 i = open(inp,'r').readlines()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
9 o = open(outp,'w')
0183cad9d13b planemo upload
fubar
parents:
diff changeset
10 for row in i:
0183cad9d13b planemo upload
fubar
parents:
diff changeset
11 rs = row.rstrip()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
12 rs = list(rs)
0183cad9d13b planemo upload
fubar
parents:
diff changeset
13 rs.reverse()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
14 o.write(''.join(rs))
0183cad9d13b planemo upload
fubar
parents:
diff changeset
15 o.write('\n')
0183cad9d13b planemo upload
fubar
parents:
diff changeset
16 o.close()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
17 #end raw