could some who keeps more up to date than i tell me what the current preferred way of running a sub process is in python?
should i be using os.popen, popen2, subprocess.Popen, etc?
and a similar question,
is it possible to create a pipe to just a shell, keeping it open for later commands?
i was trying to create a single object (e.g. shell) that i could read and write to, like a shell command line, something lie this
Code:
try:
shell.write('command -to run')
output = shell.readlines()
except:
print 'this went wrong', shell.stderr
i tried this a few ways, and never could get all the pipes working. i either get file errors or it loops indefintely (atleast until i hit ctrl+c) while reading.