本文整理匯總了Python中Event.eventLoop方法的典型用法代碼示例。如果您正苦於以下問題:Python Event.eventLoop方法的具體用法?Python Event.eventLoop怎麽用?Python Event.eventLoop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Event
的用法示例。
在下文中一共展示了Event.eventLoop方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: range
# 需要導入模塊: import Event [as 別名]
# 或者: from Event import eventLoop [as 別名]
for i in range(1,len(sys.argv)):
result = re.search('([0-9]+(?:\.[0-9]+){3}):([0-9]+)', sys.argv[i])
if result is not None:
#print "Found host:" + result.group(1) + " port:" + result.group(2)
hosts.append((result.group(1), int(result.group(2))))
else:
#print "Found file " + sys.argv[i]
files.append(sys.argv[i])
print "Will send files:" + str(files) + " to hosts:" + str(hosts)
Logging.Logger.setFile("sender.log")
for fileToSend in files:
fileSender = FileSender(fileToSend, hosts)
fileSender.send()
Event.eventLoop()
#For unpacking we first need to know the size of the data
#eceivedPacker = RudpPacket().unpack(packet.pack());
#print receivedPacker
#print "Secnum:" + str(receivedPacker.seqnum) + " Data length:" + str(receivedPacker.datalength)
#print "Data:" + receivedPacker.data
示例2: start
# 需要導入模塊: import Event [as 別名]
# 或者: from Event import eventLoop [as 別名]
def start(self):
self.rudpSocket = Rudp.createSocket(self.host, self.port)
Rudp.registerReceiveHandler(self.rudpSocket, self.receiveHandler)
print "Started Receiver on " + str(self.rudpSocket.socket.getsockname())
Event.eventLoop()