os.getenv(key, default=value)
Get the "key" environment variable, if it is not defined, use the default value as the result.
#!/usr/bin/env python
import osimport sys
VT_ROOT = os.getenv("VDE_TOOL_DIR", default = "/opt/vde/services/instances/vt2124")VT_CMD = VT_ROOT + "/bin/vde_tool"CT_CMD = VT_CMD + " ct "
print CT_CMDos.system
import osimport sys
VT_ROOT = os.getenv("VDE_TOOL_DIR", default = "/opt/vde/services/instances/vt2124")VT_CMD = VT_ROOT + "/bin/vde_tool"CT_CMD = VT_CMD + " ct "
print CT_CMDos.system
No comments:
Post a Comment