Set an environment variable

Eric Brunel eric_brunel at
Mon Oct 24 10:05:12 CEST 2005

On Fri, 21 Oct 2005 20:13:32 -0000, Grant Edwards <grante at> wrote:

> On 2005-10-21, Mike Meyer <mwm at> wrote:
>> Grant Edwards <grante at> writes:
>>> My point: the OP wanted to know how to export an environment
>>> variable to a child process.  Either of the lines of code above
>>> will do that, so what's with all the shellular shenanigans?
>> Actually, the OP didn't say he wanted to export a variable to a child
>> process. He said he wanted to know how to do the equivalent of "export
>> SYMBOL=value", which got intreprted as "setting a variable in the
>> parent shell."
> The only think you can export an environment variable to is a
> child process

Well, you know that, and I know that too. From my experience, many people don't...

> so I thought it obvious that was what he was
> doing with the "export" command example.

Well, when I first read the OP's message, I thought it was obvious he wanted to export the variable to the parent shell. Re-reading it, it was actually not so obvious, so my apologies for not having included an example using os.environment...
python -c "print ''.join([chr(154 - ord(c)) for c in 'U(17zX(%,5.zmz5(17;8(%,5.Z65\'*9--56l7+-'])"

More information about the Python-list mailing list