Skip to main content

CLI App to manage window environment variables

Project description

About

Command Line Application and Python Package to Add/Append/Remove environment variables on Windows systems

Table of Contents

  1. Installation
  2. CLI
    1. Get variable
    2. Create/Replace variable
    3. Append to existing variable
    4. Delete variable
  3. Python Package
    1. Get variable
    2. Create/Replace variable
    3. Append to existing variable
    4. Delete variable

Installation

To install the package you need to run

python -m pip install py-setenv

How to use as CLI application

Get variable (CLI)

Get value of variable my_var

:: User environment
setenv my_var -u
:: System environment
setenv my_var

Create/replace variable (CLI)

Set variable my_var to 1

:: User environment
setenv my_var -v 1 -u

:: System environment
setenv my_var -v 1

Append to existing variable (CLI)

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 (CLI)

Delete variable my_var

:: User environment
setenv my_var -d -u

:: System environment
setenv my_var -d

How to use as Python package

Get variable

Get value of variable my_var

from py_setenv import setenv
setenv("my_var")

Create/replace variable

Set variable my_var to 1

from py_setenv import setenv
setenv("my_var", value=1, user=True)

Append to existing variable

Append my/test/dir to path variable

from py_setenv import setenv
setenv("path", value="my/test/dir", append=True, user=True)

Delete variable

Delete variable my_var

from py_setenv import setenv
setenv("my_var", delete=True, user=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_setenv-1.0.3.tar.gz (2.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page