msyz999明仕亚洲怎样运转python文件

按照教程写了个复杂的文件后,运转之后发明localhost衔接不上,这是为什么?


    #!/usr/bin/env python3
# -*- coding: utf-8 -*-

__author__ = Michael Liao


async web application.


import logging; logging.basicConfiglevel=logging.INFO

import asyncio, os, json, time
from datetime import datetime

from aiohttp import web

def indexrequest:
    return web.Responsebody=b<h1>Awesome</h1>

async def initloop:
    app = web.Applicationloop=loop
    app.router.add_routeGET, /, index
    srv = await loop.create_serverapp.make_handler, 127.0.0.1, 9000
    logging.infoserver started at http://127.0.0.1:9000...
    return srv

loop = asyncio.get_event_loop
loop.run_until_completeinitloop
loop.run_forever

你的端口是9000 ,你用的9090端口拜访了
http://localhost:9000

(看完/读完)这篇文章有何感想! msyz999明仕亚洲的分享…

发表评论

姓名 *
电子邮件 *
站点