![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 115 阅读 · 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 · 133 阅读 · 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 · 555 阅读 · 0 评论 -
python组件总汇
[b]1)xml[/b] xml.etree.ElementTree可处理简单的,对xpath支持的不好,比如attr不支持 xpath可使用py-dom-xpath库: [code="java"]import xpath from xml.dom import minidom doc = minidom.parse("../config/user.xml") names = xp...2012-05-17 14:39:49 · 265 阅读 · 0 评论