python challenge 17

View Code
 1 #-*- coding:utf8-*-
2 import time
3 start = time.time()
4
5 from urllib2 import Request,urlopen
6 from urllib import quote_plus
7 info='the flowers are on their way'
8 url='http://www.pythonchallenge.com/pc/stuff/violin.php'
9 req = Request(url, headers={'Cookie': 'info=' + quote_plus(info)})
10 print urlopen(req).read()
11
12 print "耗时:"+str(time.time() - start)
posted @ 2012-02-10 18:35  lcyang  阅读(322)  评论(0编辑  收藏  举报