摘要:
http://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.htmlhttp://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.htmlBest Practices for Exception HandlingbyGunjan Doshi11/19/2003One of the problems with exception handling is knowing when and how to use it. In this article, I will cover some of 阅读全文
摘要:
http://blog.tugai.net/2011/05/13/fiddler-safari-mobile/用FIDDLER抓取SAFARI MOBILE数据包西风瘦马 发布于 五月 13, 2011因工作的原因,最近尝试了在Safari mobile浏览器(iPad、iPhone、iTouch)下开发网页。当网页开发完成后,需要放到线上用真机查看最终效果,在这个过程中,我发现调试很困难,无法查看源码、无法使用firebug之类的工具动态修改DOM、js、css等文件。上阵子在公司内部分享Fiddler使用技巧时,我曾经提到过使用Fiddler作为代理服务器抓取第三方设备的数据包,当时演示的 阅读全文
摘要:
http://chadaustin.me/2009/03/reporting-crashes-in-imvu-creating-your-very-own-symbol-server/Why should I run my own symbol server?Once you create a symbol server, you can easily debug a release build of your program from any computer with network access to the symbol server.Existing tools such as Wi 阅读全文
摘要:
import smtplibimport osfrom email.MIMEMultipart import MIMEMultipartfrom email.MIMEBase import MIMEBasefrom email.MIMEText import MIMETextfrom email.Utils import COMMASPACE, formatdatefrom email import Encodersdef send_mail(send_from, send_to, subject, text, files=[], server="localhost"): 阅读全文
摘要:
http://stackoverflow.com/questions/1758354/how-to-produce-html-unit-test-output-in-pythonI'm looking for any way to display the results of python unit tests in an html summary. There are tools like this for Java and Ruby... haven't yet located any tools that seem to do this for Python. Are t 阅读全文
摘要:
http://blog.csdn.net/yatere/article/details/66554451.简单的将日志打印到屏幕importlogginglogging.debug('This is debug message')logging.info('This is info message')logging.warning('This is warning message')屏幕上打印:WARNING:root:This is warning message默认情况下,logging将日志打印到屏幕,日志级别为WARNING;日志级别大小 阅读全文
摘要:
http://stackoverflow.com/questions/2535760/python-try-except-comma-vs-as-in-exceptWhat is the difference between ',' and 'as' in except statements, eg:try: passexceptException, exception: passand:try: passexceptExceptionas exception: passIs the second syntax legal in 2.6? It works in 阅读全文
摘要:
http://www.tutorialspoint.com/cgi-bin/printversion.cgi?tutorial=python&file=python_exceptions.htmPython Exceptions HandlingPython provides two very important features to handle any unexpected error in your Python programs and to add debugging capabilities in them:Exception Handling:This would be 阅读全文
摘要:
http://hi.baidu.com/thinkinginlamp/blog/item/8905564e1f771c0eb3de05ec.html如何在Python中调用父类的同名方法2009年02月05日 星期四 下午 3:38作者:老王Python中对象方法的定义很怪异,第一个参数一般都命名为self(相当于其它语言的this),用于传递对象本身,而在调用的时候则不必显式传递,系统会自动传递。举一个很常见的例子:>>> class Foo: def bar(self, message): print(message)>>> Foo().bar(&quo 阅读全文
摘要:
http://hi.baidu.com/ngulinyong/blog/item/e6c86901448f53017bec2c86.html1)如果是要打开一个文件,那最好的方法是:import osos.startfile('example.txt')效果与双击该文件相同2)同步运行新程序:import osos.system('notepad')#orimport subprocesssubprocess.call(['notepad'])3)异步运行新程序:import subprocessexeProcess = subprocess.P 阅读全文