Re: How to pass shell variable to shell script from python

Discussion in 'Python' started by Christian Heimes, Feb 27, 2008.

  1. Rockins Chen wrote:
    > Hi all,
    >
    > I encountered a problem: I have a python script, let's just name it
    > caller.py, It calls a shell script, which is named callee.sh. In callee.sh,
    > it need a shell variable $target, which should be supplied by caller.py(cannot
    > pass by argument). I try to use os.environ to do this, as follows:


    Don't use os.system or the popen functions. They have been substituted
    with the subprocess module. It has a way to pass a new environment to a
    process.

    Christian
    Christian Heimes, Feb 27, 2008
    #1
    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. David Tweet
    Replies:
    0
    Views:
    831
    David Tweet
    Dec 6, 2007
  2. Gerardo Herzig
    Replies:
    1
    Views:
    1,058
    Philipp Pagel
    Feb 27, 2008
  3. D'Arcy J.M. Cain
    Replies:
    0
    Views:
    844
    D'Arcy J.M. Cain
    Feb 27, 2008
  4. Tricky
    Replies:
    0
    Views:
    560
    Tricky
    Mar 19, 2009
  5. moongeegee

    execute a shell script in a shell script

    moongeegee, Dec 3, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    236
    Ben Morrow
    Dec 4, 2007
Loading...

Share This Page