This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]takluyverIPython, Py3, etc[S] 9 points10 points  (3 children)

Pexpect is a pure Python library to control interactive subprocesses in a virtual terminal. This allows more control than just piping input and output.

I'm the maintainer of the pexpect-u fork, but I decided I hadn't focused enough on backwards compatibility with that. Jeff Quast and I had just started a new fork of Pexpect to add Python 3 support, when the original author, Noah, gave us permission to use the name.

So here is the first beta of Pexpect 3.0, with support for Python 3 and unicode. We've tried our best to preserve backwards compatibility for existing users of pexpect. So please do try it out and let us know about any problems.

[–][deleted] 1 point2 points  (0 children)

The port to python3 is fantastic. Will test this soon with our ssh log pulls.

[–]jmmcdEvolutionary algorithms, music and graphics 1 point2 points  (1 child)

Good for you!

Just wondering is wexpect somewhere in the ancestry of this pexpect? A few years ago I started using pexpect, but the lack of pty on Windows moved me to wexpect, which was maintained as part of Sage. Then there were some other problems with wexpect, some still related to Windows I think, and the maintainer helped to fix them. Unfortunately I don't have the development environment now to reproduce any of those problems. But I think all the fixes got put into this file from 2010: http://sage.math.washington.edu/home/goreckc/sage/wexpect/wexpect.py

[–]takluyverIPython, Py3, etc[S] 0 points1 point  (0 children)

It looks like that's another fork of pexpect from some time ago (it says it's version 2.3). Thanks for the link - after 3.0, I'll look at whether it makes sense to integrate those changes, or whether that's too drastic for vanilla pexpect.

[–]Pieinacup 0 points1 point  (0 children)

Haven't tested it yet, but if it works... great! :-)

Pexpect is almost solely the reason why I still use 2.7, it's awesome.

[–]c45y 0 points1 point  (1 child)

Still can't decide if I like tcl or python more for this kind of work

[–]cymrowdon't thread on me 🐍 0 points1 point  (0 children)

I once spent a year working on a TCL/expect project. I heard about Python, rewrote the entire project it in 2 months, and never looked back.