> Code A: > > p = subprocess.Popen( ['python', '-V'], env={ 'PYTHONPATH': 'C:/ > Documents and Settings/David Gould/workspace/DgTools/Common/Trunk/ > Source' } ) > print p.communicate()[0] > print p.returncode > > Output: > > None > -1072365564 My *guess* is that since PATH is not in the environment you're passing, the shell can't find the python interpreter. Try: from os import environ from subprocess import Popen, PIPE env = environ.copy() # Warning: override existing PYTHONPATH env["PYTHONPATH"] = "C:/Documents and Settings/David Gould/workspace/ DgTools/Common/Trunk/Source" p = = subprocess.Popen(['python', '-V'], env=env, stdout=PIPE) print p.communicate() print p.returncode
HTH, -- Miki <miki.teb...@gmail.com> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list