11 lines
268 B
Python
11 lines
268 B
Python
|
### Util library for general file handling
|
||
|
|
||
|
|
||
|
def replaceTextInFile(filepath, oldText, newText):
|
||
|
file = open(filepath, "rt")
|
||
|
newFile = file.read().replace(oldText, newText)
|
||
|
file.close()
|
||
|
file = open(filepath, "wt")
|
||
|
file.write(newFile)
|
||
|
file.close
|