os.putenv ?

Jacek Generowicz Jacek.Generowicz at cern.ch
Thu Mar 27 02:53:53 EST 2003


"Chermside, Michael" <mchermside at ingdirect.com> writes:

> >  > cat > grrr.py
> >  import os
> >  os.putenv("GRRR","This is a late parrot.")
> >  print "GRRR has been set to:", os.getenv("GRRR")
> >  > echo $GRRR
> >  
> >  > python grrr.py 
> >  GRRR has been set to: None
> >  > echo $GRRR
> >  
> >  
> >  What am I missing ?

[...]

> What are you trying to achieve?  Perhaps there's a better way.

Set up the environment for a user who is about to be running lots of
Python scripts ... without having to write a shell script for each
flavour of UNIX shell under the sun ... so trying it in Python seemed
the natural way.




More information about the Python-list mailing list