![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
懒是动力之源
这个作者很懒,什么都没留下…
展开
-
python 使用openpyxl和xlwt从mysql导出excel
通过scrapy 我的数据库爬到了2w多的数据,想着尝试从mysql中导出到excel 于是尝试了 xlwt包+pymysql 在3.6的环境下导出,不曾想到,表中字段content内容过长,导致xlwt包没办法实现,通过搜索找到了openpyxl包,可以解决这个问题 但是一般字段长度的表还是能够用xlwt导出的 先给出xlwt的代码xlwt+pymsqlimport p原创 2018-01-12 11:30:57 · 2066 阅读 · 3 评论 -
python 爬虫通过bloomfilter实现增量爬取/去重(重复爬取)/更新爬取
直接上代码import osfrom pybloom_live import BloomFilterfrom scrapy.exceptions import DropItemclass BloomCheckPipeline(object): def __int__(self): file_name = 'bloomfilter' def open_spider(s原创 2017-12-29 11:37:00 · 6899 阅读 · 10 评论 -
python 超类 super() 方法初探
super()应用场景对象A 有一个初始化属性first_name在__init__()方法中 以及一个 second_name()方法,当对象B继承了对象A时,对象B就拥有了对象A的所有方法和属性class A(): def __init__(self): self.first_name = 'king' def second_name(self)...原创 2018-07-18 17:58:23 · 2955 阅读 · 0 评论 -
python bloomfilter 布隆过滤器
本文使用的是pybloom_live包 git地址 https://github.com/joseph-fox/python-bloomfilter “` import os from pybloom_live import BloomFilter animals = [‘dog’, ‘cat’, ‘giraffe’, ‘fly’, ‘mosquito’, ‘horse’, ‘eagle原创 2017-12-29 09:33:09 · 750 阅读 · 0 评论 -
python3 3des des aes 加密 PKCS7 填充
首先感谢 孤影惆怅 大佬的文章 得以完美安装好了PyCrypto 包 文章地址:http://blog.csdn.net/a624806998/article/details/78596543使用PyCrypto包的 AES 加密from Crypto.Cipher import AESimport base64BS = AES.block_sizedef pad(s): retu原创 2017-12-28 13:59:07 · 8015 阅读 · 1 评论