0

Suppose I run a command cmd="start python Testscript.py" using subprocess in python.

subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  1. Is there any way to get the output of the new command console ?
  2. Is there any way to get the return code from the TestScript.py into the calling python function.
jfs
  • 399,953
  • 195
  • 994
  • 1,670
  • 1- Is there a reason, not to run the `python` executable directly without the shell and the `start` command? 2- Can you modify `Testscript.py`, to [import it instead of running it as a subprocess](http://stackoverflow.com/q/30076185/4279)? – jfs Mar 24 '16 at 00:21
  • As I need to show the result of the running script in a new console window.so i was curious about the possibilities – GetItDone Mar 31 '16 at 12:43

0 Answers0