Documentation
¶
Overview ¶
Package pyfind finds a Python 3 interpreter. On Linux and macOS that is "python3". On Windows there is usually no python3.exe: Python from python.org installs "python" and the "py" launcher, and Windows ships a "python3.exe" stub that only opens the Microsoft Store. So on Windows each candidate is also run once to check that it is a real Python 3.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgsFor ¶
ArgsFor returns the arguments a command name needs before the script's own. Only the Windows "py" launcher needs one: it picks Python 3.
func CheckArgs ¶
func CheckArgs(in Interpreter) []string
CheckArgs returns the full arguments for the one-off run that checks an interpreter is Python 3.
func IsStoreStub ¶
IsStoreStub reports whether path looks like the Windows Store alias: a file of length zero. Running it opens the Microsoft Store, so it must never be started.
func Runs ¶
func Runs(in Interpreter) bool
Runs reports whether in starts and is Python 3. It gives up after a short time, so a program that never returns cannot hang the caller.
Types ¶
type Interpreter ¶
Interpreter is a Python command: the program to run and any arguments that must come before the script's own (the "py" launcher needs "-3").
func Find ¶
func Find(goos string, lookPath func(string) (string, error), works func(Interpreter) bool) (Interpreter, bool)
Find looks for a working interpreter for goos. lookPath is exec.LookPath in real use. works is called on Windows only, to run a candidate; if it is nil, any command found on PATH is accepted.
func FindOnThisMachine ¶
func FindOnThisMachine() (Interpreter, bool)
FindOnThisMachine finds a Python 3 interpreter on the machine running vegaload.