programmatically manipulation environment variables of the calling shell

Diez B. Roggisch deets at nospam.web.de
Mon Mar 12 06:40:11 EDT 2007


Maxim Veksler wrote:

> Hello list,
> 
> I'm trying to write a python script that would allow me to manipulate
> shell variables of the calling shell. I'm trying to write some logic
> that would know to add LD_LIBRARY_PATH to the users environment.
> 
> In bash this is done with "export", can I do this with python? (If at
> all possible because python is actually a sub process of bash).

It's not possible, OS restrictions - you are not allowed to alter the
environment of a parent process. 

Diez



More information about the Python-list mailing list