Embed interactive shell (VTE) in a PyGtk GUI to manipulate its own widgets

放肆的年华 提交于 2020-01-14 03:12:06

问题


I am planning to do the folliwing:

Create a PyGtk GUI (hardcoded, no Glade) with some widgets, and at the bottom of the screen put some sort of VTE (Virtual Terminal Emulator) from where I could manipulate the widgets, for example changing their attributes and calling their methods from the commandline.

The result would be similar to using AutoCAD's commands, only that I would be acting upon the GUI objects.

I have already found very few things about gtk.VteTerminal widget, but not only could not find a working example or make one myself, it also seem to be a system terminal, not a "current session" python terminal where I could run python commands and access GUI objects.

Any suggestion?

Thanks for reading


回答1:


What you want exists already: GtkParasite. It's meant for debugging, but I'm sure if you wanted it to actually be a part of your application, you could adapt it.




回答2:


I'm late to the party, but I had a similar problem. Look here Virtual Terminal Question

It's an option if you decide to do something different than what you might have already done.



来源:https://stackoverflow.com/questions/5993390/embed-interactive-shell-vte-in-a-pygtk-gui-to-manipulate-its-own-widgets

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