摘要: 要使我们的对象支持with语句,必须为它实现 __enter__和__exit__方法。先看一个例子:from socket import socket, AF_INET, type=SOCK_STREAMclass lazyConnection: def __init__(self, add... 阅读全文
posted @ 2015-07-30 15:51 Jolin123 阅读(247) 评论(0) 推荐(0) 编辑
摘要: hello world WSGI appWSGI应用WSGI环境用environ参数创建Request请求Responseshello world WSGI appdef application(environ, start_response): start_response( ... 阅读全文
posted @ 2015-07-30 15:06 Jolin123 阅读(226) 评论(0) 推荐(0) 编辑