annotate toolfactory/test-data/pyrevpos.python @ 0:83f8bb78781e draft

Uploaded
author fubar
date Fri, 11 Dec 2020 02:51:15 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
83f8bb78781e Uploaded
fubar
parents:
diff changeset
1 # reverse order of text by row
83f8bb78781e Uploaded
fubar
parents:
diff changeset
2 import sys
83f8bb78781e Uploaded
fubar
parents:
diff changeset
3 inp = sys.argv[1]
83f8bb78781e Uploaded
fubar
parents:
diff changeset
4 outp = sys.argv[2]
83f8bb78781e Uploaded
fubar
parents:
diff changeset
5 i = open(inp,'r').readlines()
83f8bb78781e Uploaded
fubar
parents:
diff changeset
6 o = open(outp,'w')
83f8bb78781e Uploaded
fubar
parents:
diff changeset
7 for row in i:
83f8bb78781e Uploaded
fubar
parents:
diff changeset
8 rs = row.rstrip()
83f8bb78781e Uploaded
fubar
parents:
diff changeset
9 rs = list(rs)
83f8bb78781e Uploaded
fubar
parents:
diff changeset
10 rs.reverse()
83f8bb78781e Uploaded
fubar
parents:
diff changeset
11 o.write(''.join(rs))
83f8bb78781e Uploaded
fubar
parents:
diff changeset
12 o.close()
83f8bb78781e Uploaded
fubar
parents:
diff changeset
13