通过服务器端更改并保存html文件

问题描述 投票:0回答:1

关于通过服务器端更改html文件,我有一个问题。我会解释:我正在尝试构建队列管理系统,并且希望在客户端显示队列。看起来应该像这样:enter image description here

但是问题是我不知道如何通过服务器更改html。如果重要,我正在使用python3(aiohttp + asyncio)。

python client-server aiohttp
1个回答
0
投票

编辑:这个问题被我误解了,请看JuiceFV的评论以得到适当的答案。

提供网页的服务器的简单示例如下:

from aiohttp import web
routes = web.RouteTableDef()

@routes.get('/')
async def hello(request):
    return web.Response(text="<html><body><h2>Hello, world</h2></body></html>", content_type="text/html")

app = web.Application()
app.add_routes(routes)
web.run_app(app)

它在客户端产生Hello,world

© www.soinside.com 2019 - 2024. All rights reserved.