易截截图软件、单文件、免安装、纯绿色、仅160KB

python之娱乐类:魔法传值

还记得是一个月的事情,神奇般的在youtube上搜索python,有个老外的教程里面有这么个内容:
#=============================
## python 魔法传值
#============================= 
#-*-coding:utf-8-*-
class sono:
    def Dict(self,**args):
        return args
    def Tuple(self,*args):
        return args
if __name__ == "__main__":
    inst = sono()
    dic = inst.Dict(a=1,b=2)
    tple = inst.Tuple(1,2)
    print dic,tple
有趣的传值(**args) 可以返回字典  就是对输入的数据比较严格 需要 A:X 形式


相关文档:

python算法实践4 快速排序

#快速排序
def Partition(mylist, low, high):
tmp = mylist[low]
while low < high:
while low < high and mylist[high] >= tmp:
high = high - 1
if low < high:
mylist[low] = mylist[high]
low = low + 1
while low < hi ......

Python安装MySQLDb模块的种种问题及解决


我的环境是:Linux version 2.4.21-4.EL
(bhcompile@daffy.perf.redhat.com) (gcc version 3.2.3 20030502 (Red Hat
Linux 3.2.3-20)) #1 Fri Oct 3 18:13:58 EDT 2003 + Python2.6.4
本文结合我安装时候的问题,总结而成
用户目录如/home/liuguanyu/ , 保证用户有root权限
1,看看有没有安装
 &nbs ......

Python模块随想随记

时常见到一些好的Python模块,如果不随时记下,等用的时候又是一阵乱翻,好在Python引用一个模块极其方便,OK,废话少说:
1. decimal
标准模块,2.4引入,用于浮点数的精确表示:
>>> 0.1 + 0.1 + 0.1 - 0.3
5.5511151231257827e-17
>>> from decimal import Decimal
>>> def _(x): retu ......

才发现 Python 被和谐了

昨天在研究了几天PHP-GTK后,决定转向Python,因为Python具有多线程这个特点,在与系统交互方面也比较有优势,虽然我很喜欢PHP,PHP在网页方面也非常强大,但毕竟我不是搞网站开发的。
想下个Python吧,发现它居然被和谐了,太诡异了
唉,和谐有理,屏蔽无罪! ......

PDF自动改名的Python程序


下载的PDF文档中有的命名很乱,就想起了自己写个程序,然后读取PDF的title属xing,根据这个属xing,更改次文档的名字!以下是代码:
需要到:http://pybrary.net/pyPdf/上面下载对应平台的PDF的库文件,然后安装,导入。
#encoding:utf-8
import os
import operator
from pyPdf import PdfFileWriter, PdfFileReader ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号