技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

2012年4月10日 #

代码的持续改进

摘要: #!/usr/bin/env python# -*- coding: utf-8 -*-#工厂模式def createDomTree(htmlStream,type='soup'): if type == "soup": return tnDomTreeWithSoup(htmlStream) if type == "lxml": return tnDomTreeWithlXml(htmlStream) return None #外部依赖的接口,它屏蔽了我具体使用的第三方库class tnDomTree: #public... 阅读全文

posted @ 2012-04-10 13:21 codestyle 阅读(228) 评论(0) 推荐(0)