扭曲过程中的用户交互 [英] User interaction in twisted process

查看:34
本文介绍了扭曲过程中的用户交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个需要与用户交互的扭曲进程,而不会阻塞.这个想法是要求用户输入一些数据,一旦输入了完整的一行,程序就会处理它,最终触发事件.在用户输入数据期间,反应器必须保持正常运行.

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.

是否有任何支持扭曲?

推荐答案

您可以使用 twisted.internet.stdio.请参阅 http://twistedmatrix.com/documents/current/core 上的 stdiodemo.py 和 stdin.py/示例/.

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

您也可以通过 twisted.internet.gtk2reactor.请参阅同一示例页面中的 pbgtk2.py 示例.

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

您也可以使用其他 GUI 工具包,不过 Gtk 是最受支持的.

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

这篇关于扭曲过程中的用户交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆