English 中文(简体)
粉碎(Twisted)——从菲福读到,向多个议定书发送读数据
原标题:Python (Twisted) - reading from fifo and sending read data to multiple protocols

试图书写某种多功能的机器人(jabber/irc),读取菲福文档中的信息(大多数是线人),然后送他们去信道和jabber联系。 迄今为止,我设法建立了两家工厂,与jabber和irc连接起来,它们似乎正在发挥作用。

然而,我对阅读菲福文档提出了问题——我不知道如何在反应堆循环之外(公开档案、阅读线、近文档、跳跃到公开档案等等)阅读它,以便获取我需要发送的数据,然后获得这些数据,以反应循环在两项议定书中发送数据。 我正在寻找如何以最佳方式做到这一点的信息,但愿在黑暗中完全消失。 任何建议/帮助都将受到高度赞赏。

提前感谢!

问题回答

你们可以读/做笔稿,而不像你那样阻挡反应堆,而是使用笔记本的手稿?

在您的案例中,创建了一个实施<代码>的班子。 关于<代码>IReadDescriptor执行,见twisted.internet.tcp.Connection

我不能更具体,因为我从来不是自己做的,但我希望这可以成为起点。

The fifo is the problem. 改用记本。 这将更好地融入由Twisted活动驱动的模式。 在反应堆控制之外做事通常是错误的做法。

- 根据反馈情况更新,该信封是一种外部制约因素,不可避免。

核心问题是,你不能在你主读(仅)读写代码。 阻挡的 app光灯改为信封。 如果看不到任何东西,那就会使整个局势停滞不前。 因此,你要么仔细阅读该信,要么单独阅读该信,要么把该信分为两部分。

最后一种选择是最简单的——修改信片,以便它能够倾听书状,并撰写一份单独的“告发人”资料,该信简而言之,读书,并撰写它所听到的所有材料。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签