Replaced readlink -f with python