annotate toolfactory_docker/test-data/pyrevpos.python @ 2:a5c5652823a6 draft

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