摘要: 下载: scp -r root@114.215.93.125:/var/www/html/wordpress /Users/Fiz/Documents 上传: scp -r /Users/Fiz/Documents/PycharmProjects/blog/snippets/serializers. 阅读全文
posted @ 2016-05-16 09:56 gopher-lin 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 查询方法一般有: 阅读全文
posted @ 2016-05-16 09:55 gopher-lin 阅读(200) 评论(0) 推荐(0) 编辑
摘要: scp -r root@114.215.93.125:/home/blog/snippets/serializers.py /Users/Fiz/Documents scp -r root@114.215.93.125:/var/www/html/wordpress /Users/Fiz/Docum 阅读全文
posted @ 2016-05-06 01:11 gopher-lin 阅读(127) 评论(0) 推荐(0) 编辑
摘要: exec 'print "Hello World"'Hello World eval语句用来计算存储在字符串中的有效Python表达式。下面是一个简单的例子 阅读全文
posted @ 2016-04-06 11:57 gopher-lin 阅读(210) 评论(0) 推荐(0) 编辑
摘要: import functools def add(a, b): return a + b add(4, 2) 6 plus3 = functools.partial(add, 3) plus5 = functools.partial(add, 5) plus3(4) 7 plus3(7) 10 plus5(10) 15 阅读全文
posted @ 2016-04-06 11:56 gopher-lin 阅读(126) 评论(0) 推荐(0) 编辑
摘要: scp -r /Users/Fiz/PycharmProjects/Scrapy_demo root@114.215.93.125:/home/ #! /bin/shexport PATH=$PATH:/usr/local/bincd /home/Scrapy_demonohup scrapy cr 阅读全文
posted @ 2016-04-02 21:39 gopher-lin 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1.限制IP地址单位时间的访问次数 : 分析:没有哪个常人一秒钟内能访问相同网站5次,除非是程序访问,而有这种喜好的,就剩下搜索引擎爬虫和讨厌的采集器了。 弊端:一刀切,这同样会阻止搜索引擎对网站的收录 适用网站:不太依靠搜索引擎的网站 采集器会怎么做:减少单位时间的访问次数,减低采集效率 2.屏蔽 阅读全文
posted @ 2016-04-02 20:23 gopher-lin 阅读(2449) 评论(0) 推荐(0) 编辑
摘要: import smtplib from email.header import Header from email.mime.text import MIMEText server = smtplib.SMTP('smtp.163.com', 25) server.login('18818261892@163.com', 'LBQ139196') msg = MIMEText('hello, s... 阅读全文
posted @ 2016-03-31 23:23 gopher-lin 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 第一次爬去https://segmentfault.com/t/python?type=newest&page=1 首先定义爬去的字段: 编写爬虫: 编写PIPlines 结果爬去了3456条数据源码在https://github.com/FizLBQ/SpiderPython/tree/Scrap 阅读全文
posted @ 2016-03-31 17:21 gopher-lin 阅读(213) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8 #! /usr/bin/python ''' Author fiz Date:2016-03-30 ''' import pymongo client = pymongo.MongoClient() db = client.test_db collection = db.test_collection mydict = {'name':'Lucy', 'sex':... 阅读全文
posted @ 2016-03-31 17:15 gopher-lin 阅读(144) 评论(0) 推荐(0) 编辑