def fileReplace(self, filename, pattern, to):
        f = open(filename, 'r')
        new_f = re.sub(pattern, to, f.read())
        f.close()
        f = open(filename, 'w')
        f.write(new_f)
        f.close()