Inplace File String Replacement - Windows Error
I am trying to implement the answer given here: https://stackoverflow.com/a/1388570/1461850 I have an input file zzz.txt containing: potato potato potato potato potato potato potat
Solution 1:
Instead of passing the file object, pass the file name(or list of filenames) to fileinput.input
:
fileinput.input('zzz.txt', inplace=1):
Note: Don't use file
as a variable name, file
is a built-in function.
Post a Comment for "Inplace File String Replacement - Windows Error"