#! /usr/bin/env python
+from __future__ import print_function
+
# file ReplaceValues.py
#
# This file is part of LyX, the document processor.
def SubstituteDataInFile(InFile):
for line in open(InFile):
- print SubstituteDataInLine(line[:-1])
+ print(SubstituteDataInLine(line[:-1]))
##########################################
import sys
for fname in sys.argv[1:]:
- infile = open( fname, "rb" )
+ infile = open( fname, "r" )
instr = infile.read()
infile.close()
outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" )
- if len(outstr) == len(instr):
+ if outstr == instr:
continue
- outfile = open( fname , "wb" )
+ outfile = open( fname , "w" )
outfile.write( outstr )
- outfile.close()
\ No newline at end of file
+ outfile.close()