简体   繁体   中英

Python terminal emulation

I'd like to have an xterm-compatible virtual terminal running inside a Python app. I'll need to run ncurses-based applications inside it, feed it with user's input and read its output.

So far I've found python-vte, but it only provides a GTK+ widget (libvte has the required VtePty class, but Python bindings don't) and has an unacceptable libgtk dependency.

Is there any other way to perform a teminal emulation in Python?

毕竟,我找到了pyte ,这正是我想要的。

Have you looked at this VT100 terminal emulator, also described in blog form here ? It's not an xterm emulator, but perhaps it can be leveraged for your purposes.

I have been running a Rails Tutorial site & have deployed Gateone terminal emulator for users to execute commands. Later we devloped our own Terminal emulation. Check http://github.com/pocha/terminal-codelearn .

If you just need to execute command as a user, then probably you just need http://docs.python.org/2/library/pty.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM