python模块
一 python文章索引
Total number is :102
python基础:
python基础31[__XXX__函数]
python基础31[docstring]
python基础31[help()来查看帮助]
python基础31[list+tuple+set+dict+str+file的成员方法]
python基础31[python IDE之Eclipse+PyDev]
python基础31[python内置函数列表]
python基础31[python在Linux的安装]
python基础31[visualstudio2010来编写python程序]
python基础31[安装及Helloworld]
python基础31[常用模块介绍]
python基础31[数据结构list+tuple+set+dictionary]
python语法31[iterator和generator+yield]
python语法31[keywords+builtins+modules]
python语法31[module/package+import]
python语法31[string的print和format]
python语法31[with来自动释放对象]
python语法31[函数]
python语法31[包模块实例]
python语法31[变量的作用域+global]
python语法31[基本数据类型和流程控制]
python语法31[异常处理]
python语法31[引用和拷贝]
python语法31[类]
python语法32[global与nonlocal比较]
python语法32[装饰器decorator]
python语法32[闭包]
python类库:
python类库26[PySide之helloworld]
python类库26[web2py与MVC]
python类库26[web2py之介绍]
python类库26[web2py之基本概念]
python类库26[web2py的URL映射]
python类库26[读写Excel]
python类库26[读写mysql]
python类库31[DOM+SAX解析XML和HTML]
python类库31[XML RPC实例]
python类库31[httplib2处理http的get和post]
python类库31[logging]
python类库31[python的libpath]
python类库31[使用SAX来解析xml]
python类库31[使用minidom读写xml]
python类库31[使用xml.etree.ElementTree读写xml]
python类库31[压缩与解压]
python类库31[命令行解析]
python类库31[文件和目录os+os.path+shutil]
python类库31[时间和日期]
python类库31[正则表达式]
python类库31[正则表达式之sub]
python类库31[正则表达式匹配实例]
python类库31[读写文件]
python类库31[读取环境变量]
python类库31[进程subprocess]
python类库31[进程subprocess与管道pipe]
python类库32[多线程]
python类库32[多线程同步Lock+RLock+Semaphore+Event]
python类库32[多进程]
python类库32[多进程共享高级之Manager]
python类库32[多进程同步Lock+Semaphore+Event]
python类库32[多进程通信Queue+Pipe+Value+Array]
python类库32[序列化和反序列化之pickle]
python类库32[执行外部命令]
python实例:
python实例26[sendemail]
python实例26[将log同时写入文件和显示到UI的控件中]
python实例26[查询修改文件的属性]
python实例26[计算MD5]
python实例26[验证用户是否存在于LDAP Server]
python实例31[My Stock Info]
python实例31[urllib.request.urlopen获取股票信息]
python实例31[列出目录下所有的文件到txt]
python实例31[文件夹清理]
python实例31[生成随即的密码]
python实例31[自动挂载虚拟盘]
python实例31[解析buildlog]
python实例32[glob+rmtree来删除目录和子目录及其下所有文件]
python实例32[简单的HttpServer]
python技巧:
python技巧26[python的egg包的安装和制作]
python技巧26[str+unicode+codecs]
python技巧31[Python 动态加载模块的3种方法]
python技巧31[python Tip2]
python技巧31[pythonTips1]
python技巧31[python中使用enum]
python技巧31[python文件的encoding和str的decode]
python技巧31[unicode和bytes]
python技巧31[判断操作系统类型]
python技巧31[对象相等性|dictionary模拟switchcase]
python技巧31[文件类型+打包EXE]
python技巧31[移植python2.x到3.x]
python技巧31[调用webservice]
python技巧32[常用技巧集]
python其他:
Python分布式+云计算
Python转载[编码规范]
python各种语言间时间的转化
python总结
python翻译[排序高级]
python资料
python转载[Rsync Algorithm]
python转载[正则表达式指南]
python转载[编码问题]
python基础:
python基础31[__XXX__函数]
python基础31[docstring]
python基础31[help()来查看帮助]
python基础31[list+tuple+set+dict+str+file的成员方法]
python基础31[python IDE之Eclipse+PyDev]
python基础31[python内置函数列表]
python基础31[python在Linux的安装]
python基础31[visualstudio2010来编写python程序]
python基础31[安装及Helloworld]
python基础31[常用模块介绍]
python基础31[数据结构list+tuple+set+dictionary]
python语法31[iterator和generator+yield]
python语法31[keywords+builtins+modules]
python语法31[module/package+import]
python语法31[string的print和format]
python语法31[with来自动释放对象]
python语法31[函数]
python语法31[包模块实例]
python语法31[变量的作用域+global]
python语法31[基本数据类型和流程控制]
python语法31[异常处理]
python语法31[引用和拷贝]
python语法31[类]
python语法32[global与nonlocal比较]
python语法32[装饰器decorator]
python语法32[闭包]
python类库:
python类库26[PySide之helloworld]
python类库26[web2py与MVC]
python类库26[web2py之介绍]
python类库26[web2py之基本概念]
python类库26[web2py的URL映射]
python类库26[读写Excel]
python类库26[读写mysql]
python类库31[DOM+SAX解析XML和HTML]
python类库31[XML RPC实例]
python类库31[httplib2处理http的get和post]
python类库31[logging]
python类库31[python的libpath]
python类库31[使用SAX来解析xml]
python类库31[使用minidom读写xml]
python类库31[使用xml.etree.ElementTree读写xml]
python类库31[压缩与解压]
python类库31[命令行解析]
python类库31[文件和目录os+os.path+shutil]
python类库31[时间和日期]
python类库31[正则表达式]
python类库31[正则表达式之sub]
python类库31[正则表达式匹配实例]
python类库31[读写文件]
python类库31[读取环境变量]
python类库31[进程subprocess]
python类库31[进程subprocess与管道pipe]
python类库32[多线程]
python类库32[多线程同步Lock+RLock+Semaphore+Event]
python类库32[多进程]
python类库32[多进程共享高级之Manager]
python类库32[多进程同步Lock+Semaphore+Event]
python类库32[多进程通信Queue+Pipe+Value+Array]
python类库32[序列化和反序列化之pickle]
python类库32[执行外部命令]
python实例:
python实例26[sendemail]
python实例26[将log同时写入文件和显示到UI的控件中]
python实例26[查询修改文件的属性]
python实例26[计算MD5]
python实例26[验证用户是否存在于LDAP Server]
python实例31[My Stock Info]
python实例31[urllib.request.urlopen获取股票信息]
python实例31[列出目录下所有的文件到txt]
python实例31[文件夹清理]
python实例31[生成随即的密码]
python实例31[自动挂载虚拟盘]
python实例31[解析buildlog]
python实例32[glob+rmtree来删除目录和子目录及其下所有文件]
python实例32[简单的HttpServer]
python技巧:
python技巧26[python的egg包的安装和制作]
python技巧26[str+unicode+codecs]
python技巧31[Python 动态加载模块的3种方法]
python技巧31[python Tip2]
python技巧31[pythonTips1]
python技巧31[python中使用enum]
python技巧31[python文件的encoding和str的decode]
python技巧31[unicode和bytes]
python技巧31[判断操作系统类型]
python技巧31[对象相等性|dictionary模拟switchcase]
python技巧31[文件类型+打包EXE]
python技巧31[移植python2.x到3.x]
python技巧31[调用webservice]
python技巧32[常用技巧集]
python其他:
Python分布式+云计算
Python转载[编码规范]
python各种语言间时间的转化
python总结
python翻译[排序高级]
python资料
python转载[Rsync Algorithm]
python转载[正则表达式指南]
python转载[编码问题]
二 python31代码用来自动生成本索引 (需要保存为utf-8格式)
1 #-*- coding: utf-8 -*- 2 3 import urllib.request 4 import re 5 6 pythontagurl = "http://www.cnblogs.com/itech/category/170012.html" 7 pythonarticleurlregrex = "(<a.*?href="http://www.cnblogs.com/itech/archive.*?>([Pp]ython.*?)</a>)" 8 9 # get the page content string which contains all python article links 10 pythontagpage = urllib.request.urlopen(pythontagurl) 11 pythontagstr = "" 12 for line in pythontagpage.readlines(): 13 try: 14 newline = line.decode('utf-8', 'strict') 15 #print(newline) 16 except: 17 continue 18 pythontagstr += newline 19 pythontagpage.close() 20 21 # get all link and sort 22 pythonlinkandtiles = re.findall(pythonarticleurlregrex, pythontagstr) 23 d = dict() 24 for link, title in pythonlinkandtiles: 25 d[title] = link 26 pythontitles = list(d.keys()) 27 bstr1 = "python基础" 28 bstr2 = "python语法" 29 estr = "python实例" 30 lstr = "python类库" 31 tstr = "python技巧" 32 ostr = "python其他" 33 basic = [] 34 examples = [] 35 libs = [] 36 tips = [] 37 others = [] 38 for k in pythontitles: 39 if k.startswith(bstr1) or k.startswith(bstr2): 40 basic.append(k) 41 elif k.startswith(estr) : 42 examples.append(k) 43 elif k.startswith(lstr) : 44 libs.append(k) 45 elif k.startswith(tstr): 46 tips.append(k) 47 else: 48 others.append(k) 49 basic.sort() 50 libs.sort() 51 examples.sort() 52 tips.sort() 53 others.sort() 54 55 pythonarticles = [] 56 fonts = "<br/><font color=red size = 5>" 57 fonte = ":</font>" 58 pythonarticles.append( fonts + bstr1 + fonte ) 59 for py in basic: pythonarticles.append(d[py]) 60 pythonarticles.append(fonts + lstr + fonte ) 61 for py in libs: pythonarticles.append(d[py]) 62 pythonarticles.append(fonts + estr + fonte ) 63 for py in examples: pythonarticles.append(d[py]) 64 pythonarticles.append(fonts + tstr + fonte ) 65 for py in tips: pythonarticles.append(d[py]) 66 pythonarticles.append(fonts + ostr + fonte ) 67 for py in others: pythonarticles.append(d[py]) 68 69 # generate pythonindex.html 70 pythonindex = open("pythonindex.html", "w",encoding='utf-8') 71 pythonindex.write("<html>") 72 pythonindex.write("<head>") 73 pythonindex.write("<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>") 74 pythonindex.write("<title>Python - iTech's Blog</title>") 75 pythonindex.write("</head>") 76 pythonindex.write("<body>") 77 pythonindex.write("Total number is :" + str(len(pythonarticles)) + "</br>") 78 for pa in pythonarticles: 79 pythonindex.write(pa) 80 pythonindex.write("</br>") 81 pythonindex.write("</body>") 82 pythonindex.write("</html>") 83 pythonindex.close()