annotate test-data/pyrevpos.python @ 42:b938475235e3 draft

Uploaded
author fubar
date Sun, 16 Aug 2020 08:33:09 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42
b938475235e3 Uploaded
fubar
parents:
diff changeset
1 # reverse order of text by row
b938475235e3 Uploaded
fubar
parents:
diff changeset
2 import sys
b938475235e3 Uploaded
fubar
parents:
diff changeset
3 inp = sys.argv[1]
b938475235e3 Uploaded
fubar
parents:
diff changeset
4 outp = sys.argv[2]
b938475235e3 Uploaded
fubar
parents:
diff changeset
5 i = open(inp,'r').readlines()
b938475235e3 Uploaded
fubar
parents:
diff changeset
6 o = open(outp,'w')
b938475235e3 Uploaded
fubar
parents:
diff changeset
7 for row in i:
b938475235e3 Uploaded
fubar
parents:
diff changeset
8 rs = row.rstrip()
b938475235e3 Uploaded
fubar
parents:
diff changeset
9 rs = list(rs)
b938475235e3 Uploaded
fubar
parents:
diff changeset
10 rs.reverse()
b938475235e3 Uploaded
fubar
parents:
diff changeset
11 o.write(''.join(rs))
b938475235e3 Uploaded
fubar
parents:
diff changeset
12 o.close()
b938475235e3 Uploaded
fubar
parents:
diff changeset
13