Port shell scripts to Python

/Port_shell_scripts_to_Python