popen / batchfile / environment variables

Guy guy at lightwork.co.uk
Wed Nov 27 10:44:08 EST 2002


Joerg Woelke <dvass at felis.uni-freiburg.de> wrote in message news:<3DDC7C0C.C4509EBA at felis.uni-freiburg.de>...
> Hi!
> 
> Guy wrote:
> 
> >     try:
> >         EnvVarValue=os.environ[EnviromentVarName]
> >     except:
> >         os.environ[EnviromentVarName]=""
> >         EnvVarValue=os.environ[EnviromentVarName]
> > 
> >     if EnvVarValue != "":
> >         EnvVarValue=string.split(EnvVarValue,Separator)
> >         for Value in ValuesList:
> >             EnvVarValue.append(Value)
> >         for Value in EnvVarValue:
> >             TotalEnv = TotalEnv + Value + Separator
> >         os.environ[EnviromentVarName]=TotalEnv
> >     else:
> >         for Value in EnvVarValue:
> >             TotalEnv = TotalEnv + Value + Separator
> >         os.environ[EnviromentVarName]=TotalEnv
> 
> os.putenv()
> 
> HTH, J"o!

I am aware of this. However when you work of as many different
platforms as me you find that this dosen't do what you need it to. The
function works well on all platforms that I work on. os.putenv()
don't.



More information about the Python-list mailing list