随笔分类 - 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', '', '', '', '', '
阅读全文
摘要:Good logging practice in Python这篇介绍地不错,由浅入深http://victorlin.me/posts/2012/08/26/good-logging-practice-in-pythonThere are different handlers, you can a...
阅读全文
摘要:http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.htmlhttp://www.cnblogs.com/gsblog/p/3342843.html
阅读全文
摘要:#!/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
阅读全文
摘要:写的类模块放在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
阅读全文