interactive prompts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Williams

    #1

    interactive prompts

    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
  • Ben Finney

    #2
    Re: interactive prompts

    Michael Williams <mwilliams@mgre g.com> wrote:[color=blue]
    > 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?[/color]

    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.)

    --
    \ "A society that will trade a little liberty for a little order |
    `\ will lose both, and deserve neither." -- Thomas Jefferson, in |
    _o__) a letter to Madison |
    Ben Finney

    Comment

    Working...