摘要: In this post I’m going to explain how to create a simple Python CGI Server. To illustrate the concepts involved more clearly I will not attempt to make this server extensible, rather I will try to keep the code as simple and clear as possible.To start with we need to create a directory for our serve 阅读全文
posted @ 2013-04-04 19:09 Me.thinking 阅读(1231) 评论(0) 推荐(0) 编辑
摘要: 在mkdir -p cgi/cgi-bin下面新建time.py#!/usr/bin/env python# -*- coding utf8 -*- import cgitbcgitb.enable()import timeprint "Content-type: text/html" print print time.strftime('%Y-%m-%d %X', time.localtime() )cgi 服务器建立cd cgipython -m CGIHTTPServer到 firefox 中http://127.0.0.1:8000/cgi-bin/ 阅读全文
posted @ 2013-04-04 18:40 Me.thinking 阅读(358) 评论(1) 推荐(0) 编辑