arte/utils/locate.py
def replace_in_file(filename, search, replace):
    '''Replaces a string inside a file'''

    filedata = None
    with open(filename, 'r') as f:
        filedata = f.read()

    # Replace the target string
    filedata = filedata.replace(search, replace)

    # Write the file out again
    with open(filename, 'w') as f:
        f.write(filedata)
Replaces a string inside a file
Replaces a string inside a file
Replaces a string inside a file
def replace_in_file(filename, search, replace):
    filedata = None
    with open(filename, 'r') as f:
        filedata = f.read()
    filedata = filedata.replace(search, replace)
    with open(filename, 'w') as f:
        f.write(filedata)
def replace_in_file ( filename , search , replace ) : filedata = None with open ( filename , 'r' ) as f : filedata = f . read ( ) filedata = filedata . replace ( search , replace ) with open ( filename , 'w' ) as f : f . write ( filedata )
Replaces a string inside a file
Replaces a string inside a file
'''Replaces a string inside a file''' # Replace the target string # Write the file out again
filename
search
replace