CherryPy Hello World错误 [英] CherryPy Hello World error

查看:98
本文介绍了CherryPy Hello World错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行CherryPy Hello World时:

import cherrypy

class HelloWorld:
    def index(self):
        return "Hello world!"
    index.exposed = True

cherrypy.config.update({'server.socket_port': 8080,})
cherrypy.quickstart(HelloWorld())

...我得到了:IOError:端口8080未绑定在"localhost"上.会是什么?

解决方案

您可能还在该端口上监听了其他内容.

在Linux上,请执行以下操作:

netstat -pnl | grep 8080

看看8080正在监听什么进程

在Windows上,使用 TCPView 之类的方法进行操作. /p>

When I am running CherryPy Hello World:

import cherrypy

class HelloWorld:
    def index(self):
        return "Hello world!"
    index.exposed = True

cherrypy.config.update({'server.socket_port': 8080,})
cherrypy.quickstart(HelloWorld())

... I get this: IOError: Port 8080 not bound on 'localhost'. What could it be?

解决方案

You've probably got something else listening on that port.

On Linux do:

netstat -pnl | grep 8080

And see what process is listening on 8080

On Windows use something like TCPView to do the same.

这篇关于CherryPy Hello World错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆