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


Groups > comp.lang.python > #79984 > unrolled thread

set environmental variable from python

Started byArtur Bercik <vbubbly21@gmail.com>
First post2014-10-31 10:22 +0900
Last post2014-11-01 17:30 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  set environmental variable from python Artur Bercik <vbubbly21@gmail.com> - 2014-10-31 10:22 +0900
    Re: set environmental variable from python Alexander Blinne <news@blinne.net> - 2014-11-01 17:30 +0100

#79984 — set environmental variable from python

FromArtur Bercik <vbubbly21@gmail.com>
Date2014-10-31 10:22 +0900
Subjectset environmental variable from python
Message-ID<mailman.15338.1414718595.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

I have to set environmental variable in my windows PC as follows:

variable name: GISBASE

value: C:\GRASS-64

Is it possible to set it from python?

import sys

sys.path.append("C:\\GRASS-64")

But how to give variable name? I have to set both the variable name and
value.

Thanks in the advance.

Artur

[toc] | [next] | [standalone]


#80094

FromAlexander Blinne <news@blinne.net>
Date2014-11-01 17:30 +0100
Message-ID<m331qj$atk$1@speranza.aioe.org>
In reply to#79984
Am 31.10.2014 um 02:22 schrieb Artur Bercik:
> I have to set environmental variable in my windows PC as follows:
> 
> variable name: GISBASE
> 
> value: C:\GRASS-64
> 
> Is it possible to set it from python?
> 
> import sys
> 
> sys.path.append("C:\\GRASS-64")
> 
> But how to give variable name? I have to set both the variable name and
> value.

http://lmgtfy.com/?q=how+to+set+environment+variable+with+python

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web