摘要: python除了关键字(keywords)和内置的类型和函数(builtins),更多的功能是通过libraries(即modules)来提供的。常用的libraries(modules)如下:1)python运行时服务* copy: copy模块提供了对复合(compound)对象(list,tuple,dict,custom class)进行浅拷贝和深拷贝的功能。* pickle: pickle模块被用来序列化python的对象到bytes流,从而适合存储到文件,网络传输,或数据库存储。(pickle的过程也被称serializing,marshalling或者flattening,pi. 阅读全文
posted @ 2011-01-28 16:22 iTech 阅读(14726) 评论(0) 推荐(0) 编辑
摘要: 一 使用如下代码将keywords+builtins+modules输出到文件Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->importsysdefstdoutToFile(filename,function,args):oldStdout=sys.stdoutf=open(filename,"w")sys.stdout=ffunction(args)#sys.stdout.flush()#f.close()sys.st 阅读全文
posted @ 2011-01-28 13:31 iTech 阅读(1653) 评论(1) 推荐(0) 编辑