pyfind

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

func ArgsFor(name string) []string

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

func IsStoreStub(path string) bool

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 Names

func Names(goos string) []string

Names returns the commands to try for goos, best first.

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

type Interpreter struct {
	Path string
	Args []string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL