annotate toolfactory/test-data/pyrevpos.python @ 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 # reverse order of text by row
0183cad9d13b planemo upload
fubar
parents:
diff changeset
2 import sys
0183cad9d13b planemo upload
fubar
parents:
diff changeset
3 inp = sys.argv[1]
0183cad9d13b planemo upload
fubar
parents:
diff changeset
4 outp = sys.argv[2]
0183cad9d13b planemo upload
fubar
parents:
diff changeset
5 i = open(inp,'r').readlines()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
6 o = open(outp,'w')
0183cad9d13b planemo upload
fubar
parents:
diff changeset
7 for row in i:
0183cad9d13b planemo upload
fubar
parents:
diff changeset
8 rs = row.rstrip()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
9 rs = list(rs)
0183cad9d13b planemo upload
fubar
parents:
diff changeset
10 rs.reverse()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
11 o.write(''.join(rs))
0183cad9d13b planemo upload
fubar
parents:
diff changeset
12 o.close()
0183cad9d13b planemo upload
fubar
parents:
diff changeset
13