CherryPy Hello World error

前端 未结 10 1107
广开言路
广开言路 2020-12-31 07:32

When I am running CherryPy Hello World:

import cherrypy

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

che         


        
10条回答
  •  不知归路
    2020-12-31 08:09

    Windows 10

    If you get a python exception printed to stdio that 8080 is not free on 127.0.0.1, then what you do is this:

    netstat -o -a
    

    at the windows command prompt. Doing netstat -o alone will give you an incorrect PID.

    Look for 8080 in the address string in the first column. Once found, go horizontally over to the last column which is the PID (process ID).

    Now to kill a process, I use kill which is part of an mysys install. I found that out by doing where kill on my system.

    Thus all together:

    netstat -o -a
    [find PID then hit ctrl-c to stop netstat]
    kill 13164  
    

    where 13164 is an example PID found in the first step.

    If you do not have mysys installed, then install it or else look up how to kill a process by its PID on windows.

提交回复
热议问题