摘要: 安装express,创建项目,添加sqlite3模块express --sessions --css stylus --ejs myhotelnpm install sqlite3node app #运行方式源代码如下:网站入口app.jsvar express = require('express');var routes = require('./routes');var photo = require('./routes/photo');var http = require('http');var path = requir 阅读全文
posted @ 2013-12-02 21:51 ciaos 阅读(823) 评论(0) 推荐(0) 编辑
摘要: 下载1000次网页资源1,普通循环方式下载1000次,非常慢#!/usr/bin/python# -*- coding: utf-8 -*-import sysimport osimport timeimport urllibimport urllib2total_times = 1000def worker(url): try: f = urllib2.urlopen(url,timeout=10800) body = f.read() except: print sys.e... 阅读全文
posted @ 2013-12-02 21:51 ciaos 阅读(611) 评论(0) 推荐(0) 编辑