Keyboard input using stdio.StandardIO in twisted python

扶醉桌前 提交于 2019-12-10 13:26:17

问题


I have a doubt in twisted python related to my multiclient chat server program.

that is, when we give input from keyboard using stdio.StandardIO, where it is stored when we run the reactor? Can anybody give me the answer, please..


回答1:


twisted.internet.stdio.StandardIO doesn't "store" data anywhere. It is a transport which you associate with a protocol. The protocol you associate with it can do anything you want with the data delivered to it.

You can find two examples of using StandardIO in the Twisted documentation, https://twistedmatrix.com/documents/current/_downloads/stdin.py and https://twistedmatrix.com/documents/current/_downloads/stdiodemo.py.



来源:https://stackoverflow.com/questions/8299896/keyboard-input-using-stdio-standardio-in-twisted-python

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