set environmental variable from python

Gisle Vanem gvanem at yahoo.no
Fri Oct 31 07:31:07 EDT 2014


"Artur Bercik" <vbubbly21 at gmail.com> wrote:

>I have to set several variables so it would be easier if I could set them
> from Python.

You can write a Python-script that generates a .bat file (in your %TEMP-dir?).
And run this .bat file when Python ends. Put it all in an alias or another .bat
file. E.g. untested:
 alias set_env=python <your-script> -o %TEMP%\set_env.bat & %TEMP%\set_env.bat

--gv




More information about the Python-list mailing list