随笔分类 -  Python

记录学习和使用python中遇到的问题
摘要:1、元组的方式输出格式如下:('Waiting for master to send event', '10.75.19.79', 'mysqlsync', 5580L, 60L, 'mysql-bin.000050', 300947174L, 'relay-bin.000054', 210L, 'mysql-bin.000050', 'Yes', 'Yes', '', '', '', '', ' 阅读全文
posted @ 2013-09-10 20:47 小郭学路 阅读(1481) 评论(0) 推荐(0) 编辑
摘要:Good logging practice in Python这篇介绍地不错,由浅入深http://victorlin.me/posts/2012/08/26/good-logging-practice-in-pythonThere are different handlers, you can a... 阅读全文
posted @ 2013-09-09 14:35 小郭学路 阅读(501) 评论(0) 推荐(0) 编辑
摘要:http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.htmlhttp://www.cnblogs.com/gsblog/p/3342843.html 阅读全文
posted @ 2013-08-05 15:13 小郭学路 阅读(179) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env pythonclass InstanceCount(object): count=0 def __init__(self): InstanceCount.count += 1 def __del__(self): InstanceCount.count -= 1 def printInstanceCount(self): print '='*20 print "Now instance count=",InstanceCount.countdef main(): ainstance=InstanceCount() ainstan 阅读全文
posted @ 2013-06-08 21:13 小郭学路 阅读(325) 评论(0) 推荐(0) 编辑
摘要:写的类模块放在BookEntry.py中,源码为:#!/usr/bin/env python#encoding=utf8class BookEntry(object): def __init__(self,nm,ph): self.name=nm self.phone=ph print "Created a bookentry class" def updatePhone(self,newph): self.phone=newph print "updated new phone for",self.name def printInfo(self): p 阅读全文
posted @ 2013-06-06 22:33 小郭学路 阅读(6269) 评论(0) 推荐(0) 编辑