The title to this may be confusing, but basically I want to be able to do the following:
import subprocess
subprocess.call(["python"])
subprocess.call(["import", "antigravity"])
subprocess.check_call(["print","\"This is so meta\" "])
subprocess.call(["exit()"])
Expected behavior would be that it would open up a python terminal session, then open up xkcd comic 353, print 'this is so meta' to the command line, and finally exit the python command line.
Basically, I want to be able to open a python session, and run commands in it from my python script. I also want to be able to check the output of commands I run in the script. Is this possible? and if so, what library do I need to be using? Will subprocess do this?