Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80006

Re: set environmental variable from python

From "Gisle Vanem" <gvanem@yahoo.no>
References (1 earlier) <5452EAE2.8020500@davea.name> <CA+F4vi=vXj4Ge+_69YwiNpn11gbSBmdgyouC2Z5wUpWxKPxuYQ@mail.gmail.com> <mailman.15343.1414722655.18130.python-list@python.org> <36c5d2db-a931-417e-ae8c-9c77acfc947b@googlegroups.com> <CA+F4vikA6E6mC3Z-iOrNApNvsLUVO7GMa1UiQByzZW0bfiOkPw@mail.gmail.com>
Subject Re: set environmental variable from python
Date 2014-10-31 12:31 +0100
Newsgroups comp.lang.python
Message-ID <mailman.15349.1414755253.18130.python-list@python.org> (permalink)

Show all headers | View raw


"Artur Bercik" <vbubbly21@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

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: set environmental variable from python Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-30 21:30 -0500
  Re: set environmental variable from python Rustom Mody <rustompmody@gmail.com> - 2014-10-30 19:36 -0700
    Re: set environmental variable from python Artur Bercik <vbubbly21@gmail.com> - 2014-10-31 11:43 +0900
    Re: set environmental variable from python "Gisle Vanem" <gvanem@yahoo.no> - 2014-10-31 12:31 +0100
    Re: set environmental variable from python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-31 14:17 +0000

csiph-web