User interaction in twisted process

泪湿孤枕 提交于 2019-11-30 16:16:06

问题


I am running a twisted process which needs to interact with the user, without blocking. The idea is that the user will be asked to input some data, and once a complete line has been entered, the program will process it, eventually triggering events. During the period that the user is entering data, the reactor must keep on running normally.

Is there any support in twisted for that?


回答1:


You can read from standard input using twisted.internet.stdio. See stdiodemo.py and stdin.py at http://twistedmatrix.com/documents/current/core/examples/.

You can also use Gtk using twisted.internet.gtk2reactor. See the pbgtk2.py example at the same examples page.

You can also use other GUI toolkits, though Gtk is the most well supported.



来源:https://stackoverflow.com/questions/8532387/user-interaction-in-twisted-process

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