diff --git a/planet/shell/py.py b/planet/shell/py.py index f4476fa..77cad57 100644 --- a/planet/shell/py.py +++ b/planet/shell/py.py @@ -1,4 +1,5 @@ from subprocess import Popen, PIPE +import os def run(script, doc, output_file=None, options={}): """ process an Python script """ @@ -10,7 +11,8 @@ def run(script, doc, output_file=None, options={}): options = sum([['--'+key, value] for key,value in options.items()], []) - proc = Popen(['python', script] + options, + python = os.environ.get('_', 'python') + proc = Popen([python, script] + options, stdin=PIPE, stdout=out, stderr=PIPE) stdout, stderr = proc.communicate(doc)