child = pexpect.spawn ('/bin/bash')
child.sendline('ls')
print(child.readline())
print child.before, child.after
All I get with this code in my output is
ls
ls
But when my code is
child = pexpect.spawn('ls')
print(child.readline())
print child.before, child.after
Then it works, but only for the first 2 prints. Am I using the wrong send command? I tried send, write, sendline, and couldn't find anymore.