[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

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

Christian Heimes

2/27/2008 10:54:00 AM

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