calling ksh script from python

ronan_boisard at yahoo.com ronan_boisard at yahoo.com
Thu Jun 2 16:31:30 CEST 2005


hi all,

I'm trying to call ksh script from python.
I have a file (toto.env) with a scirpt looking like:

-- begin ---
#!/bin/ksh
#
export TOTO_ENV=/home/toto
-- end ---

I call it from python like that:
-- begin ---
import commands
commands.getstatusoutput('. toto.env')
-- end ---

but it always return an error saying:
sh: TOTO_ENV=/home/home: is not an identifier

doesn anyone know why ?
no matter what I use (popen,system...) it's always the same error...
if I directly try to do
commands.getstatusoutput('export TOTO_ENV=/home/toto')
it's the same error...
and what about this sh primpt in the error message, can't I use ksh
script ?

thanks for any help

ronan




More information about the Python-list mailing list