interactive prompts

Discussion in 'Python' started by Michael Williams, Nov 27, 2005.

  1. 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
    Michael Williams, Nov 27, 2005
    #1
    1. Advertising

  2. Michael Williams

    Ben Finney Guest

    Michael Williams <> wrote:
    > 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.)

    --
    \ "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
    Ben Finney, Nov 27, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Weise
    Replies:
    1
    Views:
    577
    Thomas Weise
    Nov 15, 2004
  2. WJ
    Replies:
    2
    Views:
    483
  3. =?Utf-8?B?SklNLkgu?=

    Q: prompts windows login screen

    =?Utf-8?B?SklNLkgu?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    370
    =?Utf-8?B?SklNLkgu?=
    Jun 23, 2005
  4. Replies:
    1
    Views:
    447
    Peter Rilling
    Oct 9, 2005
  5. jlc488
    Replies:
    1
    Views:
    518
    Andrew Thompson
    Jan 21, 2005
Loading...

Share This Page