interactive prompts

M

Michael Williams

Hi all,

I'm having an issue with environment variables and spawned commands.
Specifically, I'm using "eval `ssh-agent`" and "ssh-add". My
question is, how do I force the environmental variables set by one
'popen' or 'pexpect' to propagate throughout the entire Python
session so that any commands called will see those env variables?

Regards,
Michael
 
B

Ben Finney

Michael Williams said:
how do I force the environmental variables set by one 'popen' or
'pexpect' to propagate throughout the entire Python session so that
any commands called will see those env variables?

A process's environment must be inherited from its parent, or set by
the process itself. Child processes can't affect their parent
process's environment. (This is the way it works in Unix, it's not
specific to Python.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top