How to pass shell variable to shell script from python

Christian Heimes lists at
Wed Feb 27 11:53:31 CET 2008

Rockins Chen wrote:
> Hi all,
> I encountered a problem: I have a python script, let's just name it
>, It calls a shell script, which is named In,
> it need a shell variable $target, which should be supplied by
> 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


More information about the Python-list mailing list