摘要: pyDes.py############################################################################## Documentation ############################################################################### Author: Todd Whiteman# Date: 16th March, 2009# Verion: 2.0.0# License: Publ... 阅读全文
posted @ 2012-07-20 19:15 方倍工作室 阅读(18354) 评论(0) 推荐(0) 编辑
摘要: #!/usr/local/bin/python3# coding=utf-8# Created: 20/07/2012# Copyright: http://www.cnblogs.com/txw1958/'''A Chinese Calendar Library in Python'''import os, io, sys, re, time, datetime, base64__version__ = "$Rev: 123 $"__all__ = ['LunarDate']solar_year = 1900 阅读全文
posted @ 2012-07-20 18:59 方倍工作室 阅读(11796) 评论(1) 推荐(0) 编辑
摘要: 作者:miaoo1.应用场景由于自己做的一个系统需要用到发送短信到自己手机的功能,于是搜索了一下,发现了一个通过移动飞信通道发送短信开源库:PyFetion PyFetion 模拟实现了飞信的通信协议,所以能够实现的功能非常多:短信收发、好友管理、修改状态等等等。但是,由于我只需要发送短信,所以其它功能都很多余;再加上使用PyFetion 登录飞信时可能需要输入验证码,所以不太适合自动化系统的调用。继续搜索发现了飞信为手机用户提供了一个wap站点:http://f.10086.cn PS:由于是这一个wap站点,您可能需要在FireFox中安装扩展(Extension):wmlbrowser 阅读全文
posted @ 2012-07-20 17:29 方倍工作室 阅读(6274) 评论(0) 推荐(0) 编辑
摘要: 1.性能Py3.0运行 pystone benchmark的速度比Py2.5慢30%。Guido认为Py3.0有极大的优化空间,在字符串和整形操作上可以取得很好的优化结果。Py3.1性能比Py2.5慢15%,还有很大的提升空间。2.编码Py3.X源码文件默认使用utf-8编码,这就使得以下代码是合法的: >>> 中国 = 'china' >>>print(中国) china3. 语法1)去除了<>,全部改用!=2)去除``,全部改用repr()3)关键词加入as 和with,还有True,False,None4)整型除法返回浮点数 阅读全文
posted @ 2012-07-20 17:16 方倍工作室 阅读(591) 评论(0) 推荐(0) 编辑
摘要: #!/usr/local/bin/python3# coding=gbk# http://www.cnblogs.com/txw1958/# import os, io, sys, re, time, base64, jsonimport webbrowser, urllib.requestimport unittestfrom weibopy.auth import OAuthHandler, BasicAuthHandlerfrom weibopy.api import APIfrom weibopy.api import WeibopErrorclass Test(unittest.Te 阅读全文
posted @ 2012-07-20 12:10 方倍工作室 阅读(1382) 评论(2) 推荐(0) 编辑
摘要: #!/usr/local/bin/python3#coding=gbkimport os, io, sys, re, time, json, randomfrom PIL import Image, ImageEnhance, ImageFilterdef watermark(img_source, img_water, img_new, offset_x, offset_y): try: im = Image.open(img_source) wm = Image.open(img_water) layer = Image.new('RGBA'... 阅读全文
posted @ 2012-07-20 11:16 方倍工作室 阅读(4324) 评论(0) 推荐(0) 编辑