twisted

    0熱度

    1回答

    錯誤回調我正在用Twisted的ProcessProtocol運行一個命令。 我使用的文件支架和我有幾個事件,如inConnectionLost,connectionMade等 但是,當過程結束時觸發這個事件: def processExited(self, reason): print 'processExited, status %d' % (reason.value.exitCod

    0熱度

    1回答

    我無法使用扭曲的irc框架獲取通道的主題。我的機器人加入了一個頻道,我希望它能夠查詢另一個頻道的主題。我使用topic('#channelname)發送了LIST消息,我想我會通過覆蓋topicUpdated()方法來獲得響應,但這不會被調用。我也嘗試覆蓋irc_RPL_TOPIC(),但那也沒有被調用。是的,頻道存在,是的,它有一個主題,是的,我可以使用原始套接字來獲取主題。 什麼是使用twis

    0熱度

    2回答

    以下是我通過套接字接收數據的代碼。 from twisted.internet.protocol import Factory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor class Chat(LineReceiver): def lineReceiv

    0熱度

    1回答

    在我的Python Twisted應用程序中,我需要從客戶端接收數據,執行一些數據庫操作,並且 - 取決於數據 - 在單獨的線程中運行一些阻止代碼。 到目前爲止,我有: d = get_user(user_id) d.addCallback(do_something_with_input_data, input_data) d.addCallback(run_blocking_code)

    0熱度

    1回答

    我想實現這將需要作出10000+請求,Facebook的圖形API上的Web服務的異步編程, 應該這個多線程處理等進行這 - What is the fastest way to send 100,000 HTTP requests in Python? 或者 隨着異步編程與ASYNCIO喜歡這個 - http://pawelmhm.github.io/asyncio/python/aiohttp

    1熱度

    1回答

    所以我按照指南http://tavendo.com/blog/post/going-asynchronous-from-flask-to-twisted-klein/創建一個異步web服務。 在我的代碼,我不得不將發出請求像 def query(text): resp = yield treq.get("http://api.Iwanttoquery") content = y

    2熱度

    1回答

    我從git hub上的txtnettools包中取出了下面的代碼,代碼基本上是不完整的,所以我想弄清楚如何讓代碼發送我需要調用的包,我認爲sendEcho()方法作爲一個反應堆,所以我添加了相應的行。 from random import randint import socket import struct from twisted.internet.protocol import Da

    0熱度

    1回答

    我試圖運行使用python-daemon庫的守護進程。我也正在使用扭曲的網絡。 的服務器是非常簡單的: class Echoer(pb.Root): def remote_echo(self, st): print 'echoing:', st return st if __name__ == '__main__': serverfactory =

    0熱度

    1回答

    我想從燒瓶部分發送會話數據到我的應用程序的Websocket部分。一個簡單的例子是: from flask import session class EchoServerProtocol(WebSocketServerProtocol): def __init__(self): self.user= session.get('user') def onMess

    0熱度

    1回答

    我正在尋找管道HTTP POST或PUT的內容到STDIN的過程。我使用的克萊因庫,並有下面的代碼: from klein import run, route from twisted.internet import reactor, defer, protocol import os class CurlProcProtocol(protocol.ProcessProtocol):