3 ms·
Python's pexpect is very nice: https://pexpect.readthedocs.io/en/stable/ https://pexpect.readthedocs.io/en/stable/ And if it's an ssh session you want to remot
by mikepurvis 7y ago
Python's pexpect is very nice: https://pexpect.readthedocs.io/en/stable/ https://pexpect.readthedocs.io/en/stable/
And if it's an ssh session you want to remote control, paramiko-expect is great, in particular the take_control method that lets your remote session be partly automated and partly controlled by the user running the outer program:
https://github.com/fgimian/paramiko-expect/blob/master/paramiko_expect.py#L288 https://github.com/fgimian/paramiko-expect/blob/master/param...
- takeda 7y agopexpect is nice, and basically replicates expect functionality in Python. I remember when using it it had few minor bugs, but maybe that improved.
- stjohnswarts 7y agoI like pexpect but it's next to useless on windows. If you are mostly doing ssh/ftp then paramiko is a useful (if heavy) pexpect replacement and works across platforms