Python terminal emulation

依然范特西╮ 提交于 2019-12-12 08:49:55

问题


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?


回答1:


After all, I've found the pyte, which is exactly what I wanted.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/6070998/python-terminal-emulation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!