瓶框架python - 无法访问网站

时间:2017-05-15 10:19:31

标签: python localhost bottle

我也是Python编程和Bottle框架的新手。我写了一个基本的hello,world程序,看起来像这样:

from bottle import run, route

@route('/')
def index():
    return '<h1>Hello, World</h1>'

if __name__ == '__main__':
    run(host='localhost', port=8080, debug=True)

此代码的输出是

Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.

但是当我在浏览器中输入http://localhost:8080/时,我收到错误 - “无法访问该网站”

我错过了一些配置。我正在学习使用this youtube视频

1 个答案:

答案 0 :(得分:1)

确保没有其他程序正在访问服务器。你也在使用IPyhton吗?只是一个理智检查没什么花哨的。

相关问题