How to change Windows Environment Variable

??? mkhan12 at kornet.net
Fri Aug 31 01:43:12 CEST 2001


Dear all,

How to change environment variable on Windows NT or 2000 by python?

In Visual Basic case can setting as below:

Private Declare Function GetEnvironmentVariable Lib "kernel32" _
    Alias "GetEnvironmentVariableA" (ByVal lpName As String, _
    ByVal lpBuffer As String, ByVal nSize As Long) As Long

Private Declare Function SetEnvironmentVariable Lib "kernel32" _
    Alias "SetEnvironmentVariableA" (ByVal lpName As String, _
    ByVal lpValue As String) As Long

I will waiting for good news.
Thanks.
MyeongKi Han
----------------------------------------------
MyeongKi Han 
Section Manager, Hull Part, CAD Unification Team
DAEWOO Shipbuilding & Margin Engineering Co., Ltd.
1, Aju-Dong, Koje-Si, Kyungnam, 656-714, Rep. of Korea
Tel: +82 55 680 4039,    Fax: +82 55 680 2142
Mobile: +82 17 857 5844, E-mail: mkhan at dwship.com
Web: http://www.daewooshipbuilding.co.kr

-----Original Message-----
From: activepython-admin at listserv.ActiveState.com [mailto:activepython-admin at listserv.ActiveState.com]On Behalf Of Rob
Sent: Friday, August 31, 2001 12:59 AM
To: printers at sendme.cz
Cc: python-list at python.org; activepython at listserv.ActiveState.com; tutor at python.org
Subject: Re: [Tutor] Is Python powerful enough for this?

A wrote:

> Hi,
> I have some webpages that contain FORMS. Each form has input
> fields and also some hidden fields.
> How can I easily get urlencoded string from all these fields
> like
> Key1=Value1&Key2=Value2&Key3=Value3
>
> For example:
> I have a following web page
> <html>
>
> <head>
> </head>
> <body>
> <form method="POST" action="c.cgi">
>   <p><input type="text" name="T1" size="20"></p>
>   <p><input type="checkbox" name="C1" value="ON"></p>
>   <p><textarea rows="2" name="S1" cols="20"></textarea></p>
>   <p><input type="submit" value="Submit" name="B1"><input
> type="reset" value="Reset" name="B2"></p>
> </form>
> </body>
> </html>
>
>>From the above
> I would like to receive
> T1=&S1=&C1=&B1=Submit
>
>
> Thank you for help.
> Ladislav
>


I've got an example of one way to do this sort of thing here:

http://www.lowerstandard.com/python/uselesspython1.html

It's the bottom entry on the page, labeled: "Useless Comment System". It
consists of a working example, and you can view all the Python and HTML.

Rob
--
A {} is a terrible thing to waste.
Useless Python!
http://www.lowerstandard.com/python

_______________________________________________
ActivePython mailing list
ActivePython at listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/activepython 


More information about the Python-list mailing list