duplicate bash scripts in python language