2011年6月21日
摘要: import urllibdef hook(a,b,c): #回调函数 tem = 100.0 * a * b / c if tem>100: tem=100 print '%.2f%%' % temurl = "http://192.168.102.42/www/"path = "d:\\1.txt"urllib.urlretrieve(url, path, hook) # 下载htmlf = urllib.urlopen("xxx") print f.read() # 类似于文件操作 readlines, r 阅读全文
posted @ 2011-06-21 20:05 eth0 阅读(151) 评论(0) 推荐(0) 编辑