Replace some commands by python scripts