Mercurial > repos > fubar > toolfactory2
comparison toolfactory/test-data/pyrevpos.python @ 0:fc50a3f507ab draft
Need a new repo - old tool_factory_2 is broken
author | fubar |
---|---|
date | Sat, 10 Apr 2021 02:16:35 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:fc50a3f507ab |
---|---|
1 # reverse order of text by row | |
2 import sys | |
3 inp = sys.argv[1] | |
4 outp = sys.argv[2] | |
5 i = open(inp,'r').readlines() | |
6 o = open(outp,'w') | |
7 for row in i: | |
8 rs = row.rstrip() | |
9 rs = list(rs) | |
10 rs.reverse() | |
11 o.write(''.join(rs)) | |
12 o.close() | |
13 |