G-C*_*der 1 html python twisted.web
我想运行 index.html。所以当我输入 localhost:8080 然后 index.html 应该在浏览器中执行。但它没有提供这样的资源。我正在指定 index.html 的整个路径。请帮帮我。?
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.static import File
resource = File('/home/venky/python/twistedPython/index.html')
factory = Site(resource)
reactor.listenTCP(8000, factory)
reactor.run()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3563 次 |
| 最近记录: |