annotate toolfactory/test-data/pyrevpos.python @ 0:f288fab71d8b draft default tip

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