view 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
line wrap: on
line source

# reverse order of text by row
import sys
inp = sys.argv[1]
outp = sys.argv[2]
i = open(inp,'r').readlines()
o = open(outp,'w')
for row in i:
   rs = row.rstrip()
   rs = list(rs)
   rs.reverse()
   o.write(''.join(rs))
o.close()