How to change Windows Environment Variable

Ignacio Vazquez-Abrams ignacio at openservices.net
Thu Aug 30 22:09:57 EDT 2001


On Fri, 31 Aug 2001, ??? wrote:

> Thanks quick reply. But not set to OS.
> I would like to set and using while login windows.
>
> >>>Import os
> >>>os.environ['Test'] = 'Hello '
> >>>print 'Test key in this?=', os.environ.has_key('Test')
> Test key in this?= 0
>
> But VB case OK!
>
> Please answer.

The next time you ask a question on a mailing list you might actually want to
say that you need the response CCed to you because you're not actually on the
list.

So for your benefit, here is/was my response:

> Good news:
>
> There is a GetEnvironmentVariable() function in the win32api module.
>
> Bad news:
>
> There is no SetEnvironmentVariable() function.
>
> Good news:
>
> The source code for win32api is available via CVS
>   (http://starship.python.net/crew/mhammond/cvs.html) so you can add the
>   function.
>
> Bad News:
>
> You'll need Visual Studio 6 to compile it.

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>





More information about the Python-list mailing list