Replace some bash function by their python brother + unification of checks between Linux en Mac