Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python's pexpect is very nice: 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/param...



pexpect is nice, and basically replicates expect functionality in Python. I remember when using it it had few minor bugs, but maybe that improved.


I 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




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: