Tuesday, August 3, 2010

极速 Twisted Web 60秒(1): 访问静态目录文件

[cc lang='python' ]
from twisted.web.server import Site
from twisted.web.static import File
from twisted.internet import reactor

resource = File('/tmp')
factory = Site(resource)
reactor.listenTCP(8888, factory)
reactor.run()
[/cc]

No comments:

Post a Comment