The OPS allows you to obtain user-defined environment variables and system environment variables. User-defined environment variables are defined by users, and their names start with letters. System environment variables are defined by the system, and their names start with an underscore (_).
System environment variables are classified into public environment variables and event environment variables. During the registration phase, some environment variables related to events cannot be obtained (because the events have not occurred).
opsObj.environment.get("envName")
test.py import ops opsObj = ops.ops() value, result = _opsObj.environment.get("_sysname") print("result is ", result, " and sysname is ", value)
After the script is executed, the environment variables and device names are displayed.