I would like to execute multiple commands in a row:
i.e. (just to illustrate my need):
cmd (the shell)
then
cd dir<
below python script have 3 function what you went just excute:
import sys
import subprocess
def cd(self,line):
proc1 = subprocess.Popen(['cd'],stdin=subprocess.PIPE)
proc1.communicate()
def ls(self,line):
proc2 = subprocess.Popen(['ls','-l'],stdin=subprocess.PIPE)
proc2.communicate()
def dir(silf,line):
proc3 = subprocess.Popen(['cd',args],stdin=subprocess.PIPE)
proc3.communicate(sys.argv[1])