这个提示是不是twisted框架没有安装好?

cndeer 2011-07-14 09:44:04
报错提示没有 zope.interface。
可能是twisted 需要这个的支持。
我下载了这个 放到哪个目录里?


运行上面的代码:
from twisted.internet import reactor
from twisted.internet.portocol import Protocol, Factory

class SimpleLogger(Protocol):

def connectionMade(self):
print 'Got connection from', self.transport.client
def connectionLost(self, reason):
print self.transport.client, 'disconected'
def dataReceived(self, data):
print data


factory = Factory()
factory.protocol = SimpleLogger

reactor.listenTCP(1234, factory)
reactor.run()
。。。。。。。。。。。。。。。。。。。。。。。。
错误提示如下面:
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
Traceback (most recent call last):
File "F:/python/pythonjc/test_14_8.py", line 1, in <module>
from twisted.internet import reactor
File "F:\Python27\lib\site-packages\twisted\internet\reactor.py", line 37, in <module>
from twisted.internet import selectreactor
File "F:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 17, in <module>
from zope.interface import implements
ImportError: No module named zope.interface
...全文
160 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

37,719

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧