V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
ricemo
V2EX  ›  Python

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

  •  
  •   ricemo · Apr 20, 2020 · 1544 views
    This topic created in 2200 days ago, the information mentioned may be changed or developed.

    最近一个项目在用 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

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5210 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:13 · PVG 09:13 · LAX 18:13 · JFK 21:13
    ♥ Do have faith in what you're doing.