python save json variable to file