2014-12-22
来源:互联网 发布:oracle 数据搜索引擎 编辑:程序博客网 时间:2024/06/06 03:23
1 http://www.gamefromscratch.com/
game from scratch
2 http://www.ccs.neu.edu/home/matthias/HtDP2e/part_prologue.html
racket lang
3 http://www.csdn.net/article/2014-12-17/2823183
sina post system
4 https://gitcafe.com/gdgeek/UnityGame
a unity3D game
5 http://pdos.csail.mit.edu/6.828/2011/schedule.html
a mit os course
import urllibimport reimport timeimport threadingdef getHtml(url):html = urllib.urlopen(url).read().decode('utf-8')return htmldef gettopic(html):reg = r'http://www.douban.com/group/topic/\d+'topiclist = re.findall(reg,html)x = 0for topicurl in topiclist:x+=1return topicurldef download(topic_page):reg2 = r'http://img3.douban.com/view/group_topic/large/public/.+\.jpg'imglist = re.findall(reg2,topic_page)i = 1print(imglist)download_img = Nonefor imgurl in imglist:img_numlist = re.findall(r'p\d{7}',imgurl)print(img_numlist)for img_num in img_numlist:download_img = urllib.urlretrieve(imgurl,'/home/space/hua.song/mycode/girl/%s.jpg'%img_num)time.sleep(1)i+=1print(imgurl)return download_imgdef main_loop(num,num_end,pagenum):while num <= num_end:html=getHtml('http://www.douban.com/group/kaopulove/discussion?start=%d'%num)#print(html)topicurl = gettopic(html)#print(topicurl)topic_page = getHtml(topicurl)#print(topic_page)download_img = download(topic_page)num = page_num*25page_num+=1else:print('over')page_end = int(input('input eng pagenum:'))num_end = page_end*25num = 0page_num = 1threadnum = 5while num <= num_end:num_start = numnum_stop = num + page_end / threadnum * 25pagenum = num / 25 + 1t = threading.Thread(target=main_loop,args=(num_start,num_stop,pagenum,))t.start()t.join()num = num_stop#while num <= num_end:#html=getHtml('http://www.douban.com/group/kaopulove/discussion?start=%d'%num)#print(html)#topicurl = gettopic(html)#print(topicurl)#topic_page = getHtml(topicurl)#print(topic_page)#download_img = download(topic_page)#num = page_num*25#page_num+=1#else:#print('over')
0 0
- 2014-12-22记录
- 2014-12-22
- 2014-12-22
- 2014年12月22日
- C语言学习 2014-12-22
- 2014年12月22日
- [GitHub][2014-05-12 22:00:13]IMClipboard
- 12-22-2014——星期一——作业练习
- 12-22
- 12-22
- 2014年12月13日在格尔木的22天
- 2014 12 12
- 2014-12-12记录
- 2014-1-22
- hibernate-2014-02-22
- 2014/3/22
- 日记2014-4-22
- 剪报:2014-04-22
- quartz CronExpression表达式(转载)
- AudioQueue 音频队列 转
- Android学习笔记之ProgressBar案例分析
- jquery JavaScript ajax() post() get()无法改变全局变量的值
- UIImage图片处理
- 2014-12-22
- Week 1 Course Introduction
- 时间格式转换
- Storm入门
- 关于iOS8无法定位
- HDU 4265 Science! 最大流 二分 暴力
- POJ3233Matrix Power Series
- Linux内存 Buffer和Cache的区别及Linux中查看内存的命令free
- Java获取系统中已经安装的字体