V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
0xvincebye
V2EX  ›  Python

请教一下 Twisted 库的 TCPServer 问题,需要修改一下代码支持 IPV6

  •  
  •   0xvincebye · 2020-04-20 13:31:06 +08:00 · 1196 次点击
    这是一个创建于 1482 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近一个项目在用 Twisted,看到里面的 示例代码有这么一段

    #    twistd -ny service.tac
    import os
    from twisted.application import service, internet
    from twisted.web import static, server
    
    def getWebService():
        fileServer = server.Site(static.File(os.getcwd()))
        return internet.TCPServer(8080, fileServer)
    application = service.Application("Demo application")
    service = getWebService()
    service.setServiceParent(application)
    

    但是我在 twisted.application.internet 中完全没有找到 TCPServer 这个方法,请问这是什么特殊的语法吗 twisted.application.internet 代码: https://github.com/twisted/twisted/blob/trunk/src/twisted/application/internet.py

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1160 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:29 · PVG 07:29 · LAX 16:29 · JFK 19:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.