首页 > 技术文章 > python web 测试CGI脚本

xflqm 2017-08-30 21:22 原文

1、启动一个web服务器,并运行(下面五行缺一不可)

from http.server import HTTPServer, CGIHTTPRequestHandler

port = 8080

httpd = HTTPServer(('', port), CGIHTTPRequestHandler)
print("Starting simple_httpd on port: " + str(httpd.server_port))
httpd.serve_forever()

2、加载Kelly教练的主页来运行Web应用

推荐阅读