Shell Script String Replace Function In Python