<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_python_version(path):
 # type: (str) -> str """Get python version string using subprocess from a given path."""

    version_cmd = [path, "-c", "import sys; print(sys.version.split()[0])"]
    try:
        c = vistir.misc.run(
            version_cmd,
            block=True,
            nospin=True,
            return_object=True,
            combine_stderr=False,
            write_to_stdout=False,
        )
    except OSError:
        raise InvalidPythonVersion("%s is not a valid python path" % path)
    if not c.out:
        raise InvalidPythonVersion("%s is not a valid python path" % path)
    return c.out.strip()