老师,网页上数据能出来了,但是为啥运行的时候会报错呀
import web
#路由配置
urls=(
'/','index'
)
app=web.application(urls,globals())
render=web.template.render("templates/")
class index:
def GET(self):
return render.index()
if __name__=="__main__":
app.run()
D:\pythonProject\python\python.exe D:/test/mooc/day3/web可视化2.py
http://0.0.0.0:8080/
Traceback (most recent call last):
File "D:/test/mooc/day3/web可视化2.py", line 12, in <module>
app.run()
File "D:\pythonProject\python\lib\site-packages\web\application.py", line 360, in run
return wsgi.runwsgi(self.wsgifunc(*middleware))
File "D:\pythonProject\python\lib\site-packages\web\wsgi.py", line 66, in runwsgi
return httpserver.runsimple(func, server_addr)
File "D:\pythonProject\python\lib\site-packages\web\httpserver.py", line 176, in runsimple
server.start()
File "D:\pythonProject\python\lib\site-packages\cheroot\server.py", line 1836, in start
self.prepare()
File "D:\pythonProject\python\lib\site-packages\cheroot\server.py", line 1791, in prepare
raise socket.error(msg)
OSError: No socket could be created -- (('0.0.0.0', 8080): [WinError 10048] 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。)
Process finished with exit code 1
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星