
Python
iteye_8146
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python命名规范
python源码和其他一些书籍,命名各种个性,没有一个比较统一的命名规范。于是自己总结了一些,可供参考。另,google也有一套命名规范,相当不错,可参考。[img]http://dl.iteye.com/upload/picture/pic/112667/39764fb1-2aca-33bd-964c-e0fcb29f1dbb.png[/img][b]模块名:[/b]小写...原创 2011-07-06 18:14:21 · 159 阅读 · 0 评论 -
linux调试python
python是动态语言,编译器检查不到运行时的语法问题,而这些低级问题常常造成调试效率很低。之前在linux服务器上调试,都是通过print和异常报错来排查,简直弱爆了。python内置的pdb正是调试的利器。我们先新建一个测试脚本:[code="shell"]touch debug.py[/code]内容:[code="shell"]print "hello"i = ...2011-12-27 12:15:36 · 170 阅读 · 0 评论 -
shell后台执行serve_forever()报出Input/output error
http_server.py为一个启动http服务器的脚本,大概代码:[code="python"]server_address = ("", 7000)server = BaseHTTPServer.HTTPServer(server_address, ServerHandler)server.serve_forever()[/code]现象:1)在linux shell...2011-09-07 15:39:21 · 620 阅读 · 0 评论 -
python组件总汇
[b]1)xml[/b]xml.etree.ElementTree可处理简单的,对xpath支持的不好,比如attr不支持xpath可使用py-dom-xpath库:[code="java"]import xpathfrom xml.dom import minidomdoc = minidom.parse("../config/user.xml")names = xp...2012-05-17 14:39:49 · 307 阅读 · 0 评论