Command Line Application and Python Package to Add/Append/Remove environment variables on Windows systems
Current package allows to precisely control and differentiate user and system variables
To install the package you need to run
python -m pip install py-setenv
Get value of variable my_var
:: User environment
setenv my_var -u
:: System environment
setenv my_var
Set variable my_var to 1
:: User environment
setenv my_var -v 1 -u
:: System environment
setenv my_var -v 1
Append my/test/dir to path variable
:: User environment
setenv path -v my/test/dir -a -u
:: System environment
setenv path -v my/test/dir -a
Delete variable my_var
:: User environment
setenv my_var -d -u
:: System environment
setenv my_var -d
Lists all variables
:: User environment
setenv -l
:: System environment
setenv -l
Get value of variable my_var
from py_setenv import setenv
setenv("my_var")
Set variable my_var to 1
from py_setenv import setenv
setenv("my_var", value=1, user=True)
Append my/test/dir to path variable
from py_setenv import setenv
setenv("path", value="my/test/dir", append=True, user=True)
Delete variable my_var
from py_setenv import setenv
setenv("my_var", delete=True, user=True)
Lists all variables
from py_setenv import setenv
setenv(list_all=True)
# to suppress echo to console
setenv(list_all=True, suppress_echo=True)