usage of os.environ. How to unset something

Jarkko Torppa torppa at polykoira.megabaud.fi
Thu Feb 10 18:46:46 EST 2000


In article <87v5h0$qjl$1 at nnrp1.deja.com>, ra_sekhon at my-deja.com wrote:
>Hi,
>   Starting out in Python.  Current assignment requires to verify if a
>variable exists via os.environ['variable_name'] test.  If it does then
>I need to 'unset' it.  Similar to unset variable_name call in a shell.
>Any suggestions?

If your system has unsetenv in C-library grab
 http://staff.megabaud.fi/~torppa/unsetenv.patch
it has patch for posixmodule that let's one remove environment
variables (it also patches configure.in so you need to regenerate
and run configure script) (the patch is against cvs version)

-- 
 Jarkko Torppa                torppa at staff.megabaud.fi
  Megabaud Internet-palvelut



More information about the Python-list mailing list