I connected to remote system using Python Pexpect, Now I want to execute some script(available on remote machine) on remote system is it possible?
Yes,
you can do it by adding \n
between the commands
Or,
child = pexpect.spawn('ssh MACHINE')
child.sendline('command1')
child.sendline('command2')
child.sendline('command3')
child.close()
I would advice you reading this http://pexpect.readthedocs.io/en/stable/overview.html