05 2012 档案
摘要:base64模块是用来作base64编码解码的。这种编码方式在电子邮件中是很常见的。它可以把不能作为文本显示的二进制数据编码为可显示的文本信息。编码后的文本大小会增大1/3。这里主要介绍一下base64的8个方法(encode, decode, encodestring, decodestring, b64encode,b64decode, urlsafe_b64decode,urlsafe_b64encode): 1、encode,decode:用来编码和 解码文件的,也可以对StringIO里的数据做编解码 2、encodestring,decodestring:用来编码和解码字符串 3.
阅读全文
摘要:首先感谢龙昌在http://www.oschina.net/code/snippet_93572_10721发布的金山快盘自动签到程序代码,本人在此基础上,利用wxpython做了一个程序,具体代码如下:# -*- coding: cp936 -*-#'@小五义 http://www.cnblogs.com'#'金山快盘签到程序'import urllibimport urllib2import cookielibimport jsonimport reimport wxdef create(parent): return Frame1(parent)[wxID
阅读全文
摘要:利用cookielib和urllib2模块模拟登陆163的例子有很多,近期看了《python模拟登陆163邮箱并获取通讯录》一文,受到启发,试着对收件箱、发件箱等进行了分析,并列出了所有邮件列表及状态,包括发件人、收件人、主题、发信时间、已读未读等状态。1、参考代码:http://hi.baidu.com/fc_lamp/blog/item/2466d1096fcc532de8248839.html%EF%BB%BF#-*- coding:UTF-8 -*-import urllib,urllib2,cookielibimport xml.etree.ElementTree as etr...
阅读全文
摘要:学习记录,超简单的计时器,简单的代码学会了如何在程序中进行计时处理。import time,syswhile True: s=time.ctime() length=len(s) print s time.sleep(30) #每30秒执行一次
阅读全文
摘要:删除一个非空文件夹竟然如此简单,真是强啊!import shutilshutil.rmtree('c:\\test')print 'ok'
阅读全文