Find executable (which where)
-
which
-
where
-
exec
-
LookPath
-
Unix:
which
-
Windows:
where
-
Go:
package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
path, err := exec.LookPath("python")
if err != nil {
fmt.Println("Could not find path")
os.Exit(1)
}
fmt.Printf("%v %T\n", path, path)
}
/home/gabor/venv3/bin/python string