Sys_setenv

Sys_setenv(x=None, value=None)

Set the values of environment variables

Parameters

Name Type Description Default
x Union[str, dict] string with the name of the environment variable name or a dictionary where the names are the environment variables with their corresponding values None
value str string to assign to the environment variable in case x is of type str None

Returns

Name Type Description
None

Examples

>>> from rlike import *
>>> env = Sys_setenv("UNKNOWNENV", "/path/to/folder")
>>> env = Sys_getenv("UNKNOWNENV", unset = "default-value")
>>> env
'/path/to/folder'
>>> Sys_setenv({"UNKNOWNENV": "PROJECTXYZ", "MY_HOME": "/path/to/otherfolder"})
>>> Sys_getenv("UNKNOWNENV")
'PROJECTXYZ'
>>> Sys_getenv("MY_HOME")
'/path/to/otherfolder'