import platform
from pathlib import Path


def path_to_python(basedir: str, envname: str) -> str:
    """Return the path to the python executable."""
    if platform.system() == "Windows":
        return str(Path(basedir) / envname / "Scripts" / "python")
    else:
        return str(Path(basedir) / envname / "bin" / "python")