Use check_call and check_output for subprocess