Update a file through a Python algorithm