python 入门
python语法31[string的print和format]
python语法31[基本数据类型和流程控制]
python基础31[数据结构list+tuple+set+dictionary]
python语法31[函数]
python语法31[类]
python基础31[help()来查看帮助]
最后更新:2012/1/11
一 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格式)
#
-*- coding: utf-8 -*-
import urllib.request
import re
pythontagurl = " http://www.cnblogs.com/itech/category/170012.html "
pythonarticleurlregrex = " (([Pp]ython.*?))
"
# get the page content string which contains all python article links
pythontagpage = urllib.request.urlopen(pythontagurl)
pythontagstr = ""
for line in pythontagpage.readlines():
try:
newline = line.decode( ' utf-8 ', ' strict ')
# print(newline)
except:
continue
pythontagstr += newline
pythontagpage.close()
# get all link and sort
pythonlinkandtiles = re.findall(pythonarticleurlregrex, pythontagstr)
d = dict()
for link, title in pythonlinkandtiles:
d[title] = link
pythontitles = list(d.keys())
bstr1 = " python基础 "
bstr2 = " python语法 "
estr = " python实例 "
lstr = " python类库 "
tstr = " python技巧 "
ostr = " python其他 "
basic = []
examples = []
libs = []
tips = []
others = []
for k in pythontitles:
if k.startswith(bstr1) or k.startswith(bstr2):
basic.append(k)
elif k.startswith(estr) :
examples.append(k)
elif k.startswith(lstr) :
libs.append(k)
elif k.startswith(tstr):
tips.append(k)
else:
others.append(k)
basic.sort()
libs.sort()
examples.sort()
tips.sort()
others.sort()
pythonarticles = []
fonts = "
"
fonte = " : "
pythonarticles.append( fonts + bstr1 + fonte )
for py in basic: pythonarticles.append(d[py])
pythonarticles.append(fonts + lstr + fonte )
for py in libs: pythonarticles.append(d[py])
pythonarticles.append(fonts + estr + fonte )
for py in examples: pythonarticles.append(d[py])
pythonarticles.append(fonts + tstr + fonte )
for py in tips: pythonarticles.append(d[py])
pythonarticles.append(fonts + ostr + fonte )
for py in others: pythonarticles.append(d[py])
# generate pythonindex.html
pythonindex = open( " pythonindex.html ", " w ",encoding= ' utf-8 ')
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( "Python - iTech's Blog
")
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( " Total number is : " + str(len(pythonarticles)) + " ")
for pa in pythonarticles:
pythonindex.write(pa)
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.close()
import urllib.request
import re
pythontagurl = " http://www.cnblogs.com/itech/category/170012.html "
pythonarticleurlregrex = " (
# get the page content string which contains all python article links
pythontagpage = urllib.request.urlopen(pythontagurl)
pythontagstr = ""
for line in pythontagpage.readlines():
try:
newline = line.decode( ' utf-8 ', ' strict ')
# print(newline)
except:
continue
pythontagstr += newline
pythontagpage.close()
# get all link and sort
pythonlinkandtiles = re.findall(pythonarticleurlregrex, pythontagstr)
d = dict()
for link, title in pythonlinkandtiles:
d[title] = link
pythontitles = list(d.keys())
bstr1 = " python基础 "
bstr2 = " python语法 "
estr = " python实例 "
lstr = " python类库 "
tstr = " python技巧 "
ostr = " python其他 "
basic = []
examples = []
libs = []
tips = []
others = []
for k in pythontitles:
if k.startswith(bstr1) or k.startswith(bstr2):
basic.append(k)
elif k.startswith(estr) :
examples.append(k)
elif k.startswith(lstr) :
libs.append(k)
elif k.startswith(tstr):
tips.append(k)
else:
others.append(k)
basic.sort()
libs.sort()
examples.sort()
tips.sort()
others.sort()
pythonarticles = []
fonts = "
"
fonte = " : "
pythonarticles.append( fonts + bstr1 + fonte )
for py in basic: pythonarticles.append(d[py])
pythonarticles.append(fonts + lstr + fonte )
for py in libs: pythonarticles.append(d[py])
pythonarticles.append(fonts + estr + fonte )
for py in examples: pythonarticles.append(d[py])
pythonarticles.append(fonts + tstr + fonte )
for py in tips: pythonarticles.append(d[py])
pythonarticles.append(fonts + ostr + fonte )
for py in others: pythonarticles.append(d[py])
# generate pythonindex.html
pythonindex = open( " pythonindex.html ", " w ",encoding= ' utf-8 ')
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( "
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( " Total number is : " + str(len(pythonarticles)) + " ")
for pa in pythonarticles:
pythonindex.write(pa)
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.write( " ")
pythonindex.close()
完!