03 2007 档案

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->s='测试字符串'importtempfiletemp=tempfile.TemporaryFile()print>>temp,stemp.seek(0)s1=temp.read()pytho...阅读全文
posted @ 2007-03-24 17:17 李现民 阅读(708) | 评论 (0) 编辑
摘要: 使用dump与load函数Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->foo='foo.txt'mydict={'user':'xmli','pass':'password'}mylist=['helloworld',526]fromcPickle...阅读全文
posted @ 2007-03-24 16:50 李现民 阅读(470) | 评论 (0) 编辑
摘要: 最近研究了一下Python,觉得他这种问答式的界面特别适合学习编程,下面就举两个例子。1.快速排序的算法描述>>> def qsort(aL):... if aL==[]:return []... else:... smaller=[x for x in aL[1:] if x<aL[0]] #比aL[0]小的部分... bigger=[x for x in aL[1:] ...阅读全文
posted @ 2007-03-06 20:07 李现民 阅读(525) | 评论 (2) 编辑