On Wed, 27 Feb 2008 15:37:25 +0800
"Rockins Chen" <[EMAIL PROTECTED]> wrote:
> Clearly, I made some typing mistake, it's the shbang line! it should be:
> #!/usr/bin/python
Side topic - if you want portability use the following:
#! /usr/bin/env python
--
D'Arcy J.M. Cain <[EMAIL PROTECTED]>
Gerardo Herzig <[EMAIL PROTECTED]> wrote:
> Rockins Chen wrote:
> Well, if you have to use os.system, that could be
> os.system("export target=localhost.localdomain.org; ./callee.sh")
Or os.system("env target=localhost.localdomain.org ./callee.sh")
cu
Philipp
--
Dr. Philipp Pagel
Lehrst
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.envir
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.
Clearly, I made some typing mistake, it's the shbang line! it should be:
#!/usr/bin/python
then, just set os.environ is okay:
os.environ["target"] = "localhost.localdomain.org"
according python's documentation, setting os.environ will implicitly call
os.putenv().
2008/2/27, Rockins Chen <[EMAIL