How to print output of pexpect consisting 'r' in next line of the terminal?
How to print output of pexpect consisting 'r' in next line of the terminal? Question: I have the follwoing code snippet from a pexpect script import pexpect import time username=<username> password=<password> child = pexpect.spawn(‘ssh <username>@192.168.1.219’,timeout=40) child.expect([‘MyUbuntu’,’$’,’#’]) child.sendline(<password>) child.expect([‘MyUbuntu’,’$’,’#’]) time.sleep(2) child.sendline(‘execute ping 192.168.1.2’) child.expect([‘MyUbuntu’,’$’,’#’]) k=child.before k=k.splitline for line in k: print(line) However it gives me an …