panda3d.core.ExecutionEnvironment

from panda3d.core import ExecutionEnvironment
class ExecutionEnvironment

Encapsulates access to the environment variables and command-line arguments at the time of execution. This is encapsulated to support accessing these things during static init time, which seems to be risky at best.

Inheritance diagram

Inheritance diagram of ExecutionEnvironment

__init__(param0: ExecutionEnvironment) → None
property args

Returns the nth command-line argument. The index n must be in the range [0 .. getNumArgs()). The first parameter, n == 0, is the first actual parameter, not the binary name.

Return type

Sequence[string]

property binary_name
Getter

Returns the name of the binary executable that started this program, if it can be determined.

Setter

Do not use.

Return type

string

static clearShadow(var: str) → None

Removes a value set by a previous call to shadowEnvironmentVariable(), and lets the actual value of the variable show again.

property cwd

Returns the name of the current working directory.

Return type

Filename

property dtool_name
Getter

Returns the name of the libdtool DLL that is used in this program, if it can be determined.

Setter

Do not use.

Return type

string

property environment_variables
Getter

Returns the definition of the indicated environment variable, or the empty string if the variable is undefined.

Setter

Changes the definition of the indicated environment variable.

Return type

Mapping[string]

static expandString(str: str) → str

Reads the string, looking for environment variable names marked by a $. Expands all such variable names. A repeated dollar sign ($$) is mapped to a single dollar sign.

Returns the expanded string.

static getArg(n: size_t) → str

Returns the nth command-line argument. The index n must be in the range [0 .. getNumArgs()). The first parameter, n == 0, is the first actual parameter, not the binary name.

static getBinaryName() → str

Returns the name of the binary executable that started this program, if it can be determined.

static getCwd() → Filename

Returns the name of the current working directory.

Return type

Filename

static getDtoolName() → str

Returns the name of the libdtool DLL that is used in this program, if it can be determined.

static getEnvironmentVariable(var: str) → str

Returns the definition of the indicated environment variable, or the empty string if the variable is undefined.

static getNumArgs() → size_t

Returns the number of command-line arguments available, not counting arg 0, the binary name.

Return type

size_t

static hasEnvironmentVariable(var: str) → bool

Returns true if the indicated environment variable is defined.

static setBinaryName(name: str) → None

Do not use.

static setDtoolName(name: str) → None

Do not use.

static setEnvironmentVariable(var: str, value: str) → None

Changes the definition of the indicated environment variable.

static shadowEnvironmentVariable(var: str, value: str) → None

Changes the apparent definition of the indicated environment variable by masking it within this class with a new value. This does not change the actual environment variable, but future calls to getEnvironmentVariable() will return this new value.