Python Replace Two Handle