I need to launch a python console and control its output. I am using python subprocess.Popen() to a create a new instance.
I saved following code in a python script and running it from windows command prompt. When I run the script it launches the python instance in current windows command prompt, do not launch it in a separate console.
p = subprocess.Popen(["C:\Python31\python.exe"], shell=False,
# stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
out, _ = p.communicate()
print(out.decode())