set environmental variable from python

Zachary Ware zachary.ware+pylist at
Fri Oct 31 04:00:33 CET 2014

On Thu, Oct 30, 2014 at 9:40 PM, Artur Bercik <vbubbly21 at> wrote:
> could you please elaborate 'setx <...>'?

>From a Command Prompt, do 'help setx' for details on how to use setx.

Rustom's suggestion of using regedit is going to be far easier than
using _winreg (which probably shouldn't even be considered as an
option).  Using `os.system('setx ...')` is going to be the easiest way
to do things if you have to calculate the values of your variables,
but if you just have a bunch of values that you're going to have to
key in anyway, just use setx directly (or in a batch script).


More information about the Python-list mailing list