def replace_in_file(filepath, old, new):
    """Replace :py:obj:`old` string with :py:obj:`new` in a file.
    
    :param Path filepath: 
    """
    with filepath.open() as f:
        content_as_string = f.read()
    content_as_string = content_as_string.replace(old, new)
    with filepath.open(mode='w') as f:
        f.write(content_as_string)
