def get_python_exec(py_num: float, is_py2: bool = False) -> str:
    """ Get python executable

    Args:
        py_num(float): Python version X.Y
        is_py2(bool): for python 2 version, Set True if the returned result should have python2 or False for python.

    Returns:
        str: python executable
    """
    if py_num < 3:
        if is_py2:
            py_str = "2"
        else:
            py_str = ""
    else:
        py_str = "3"

    return f"python{py_str}"