首页 > 试题广场 >

5[问答] 在自己的机器上配置IIS以支持Python脚本的

[问答题]
在自己的机器上配置IIS以支持Python脚本的运行,然后使用Python编写脚本,运行后在网页上显示“Hello world!”。
from wsgiref.simple_server import make_server

def application(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])
    return [b'<h1>Hello World!</h1>']

if __name__ == "__main__":
    http_server = make_server('', 5000, application)
    print("Start Http Server on port 5000....")
    http_server.serve_forever()
WSGI服务器
发表于 2020-06-06 11:39:30 回复(0)