![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 84
3KAI
这个作者很懒,什么都没留下…
展开
-
python types模块MethodType的一个例子
MethodType用来将方法绑定到类,下面是一个栗子:from types import MethodTypeclass student(object): passdef set_age(self,age): self.age = agedef set_name(self,name): self.name = namedef set_school(self原创 2017-12-21 18:17:10 · 2302 阅读 · 0 评论 -
python用win32com对Excel的一些操作
最近接的项目结果输出excel对格式要求特别高,所以懒得找了,直接用win32操作了。Python操作Excel的库有不少,但是各有优缺点,没有完美的,这里其他的几个库都不多说了,仅仅列下win32的一些学习记录。直接上代码: def win32Read(filepath, passWords): #====================================...原创 2017-04-19 19:29:23 · 8552 阅读 · 0 评论 -
python gettattr setattr的一个demo
不多说直接上代码,注释就是说明class student(): def __init__(self): self.__name = u"123" def __str__(self): return self.__name stu = student()#print getattr(stu,"__原创 2017-12-25 09:40:08 · 381 阅读 · 0 评论 -
python 爬虫调用谷歌翻译和百度翻译(最新)
工作中会经常用到谷歌翻译和百度翻译,因为两个的翻译结果都需要借鉴,所有经常会有个搜完换另个搜,比较麻烦,然后就做了个小工具。把谷歌翻译和百度翻译整合到一起了。 谷歌翻译和百度翻译都是分析的请求,然后request请求的,谷歌的网上比较多,比较麻烦的就是参数tk的值,网上也有tk值算法的博客,就不多说了,给大家个链接:http://blog.csdn.net/yingshukun/ar...原创 2017-12-29 11:00:38 · 7788 阅读 · 0 评论