calling ksh script from python

Magnus Lycka lycka at
Wed Jun 8 11:07:47 CEST 2005

ronan_boisard at wrote:
> thanks for your input...
> well I just find out that modifying environment through ksh call is not
> possible (can't get the new evironment back to python). 

I thought about this a few days ago. Can't you copy it like this:

import os

env_rows = os.popen('. some.script > /dev/null; env).readlines()
for row in env_rows:
     var, val = row.split('=',1)

More information about the Python-list mailing list