Mercurial > repos > fubar > toolfactory_gtn
annotate toolfactory/test-data/pyrevpos.python @ 6:efefe43f23c8 draft default tip
Uploaded
author | fubar |
---|---|
date | Fri, 30 Apr 2021 02:10:32 +0000 |
parents | 43edf22e8cbc |
children |
rev | line source |
---|---|
0
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
1 # reverse order of text by row |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
2 import sys |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
3 inp = sys.argv[1] |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
4 outp = sys.argv[2] |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
5 i = open(inp,'r').readlines() |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
6 o = open(outp,'w') |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
7 for row in i: |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
8 rs = row.rstrip() |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
9 rs = list(rs) |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
10 rs.reverse() |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
11 o.write(''.join(rs)) |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
12 o.close() |
43edf22e8cbc
Toolshed seems cranky on very old metadata. Trying a new repo. Again
fubar
parents:
diff
changeset
|
13 |