摘要: import MySQLdbconn = MySQLdb.connect(host='127.0.0.1',user='root',passwd='redhat',db='test',port=3306)cur = conn.cursor()#cur.execute('select * from t 阅读全文
posted @ 2016-04-19 19:34 FreeMan1 阅读(220) 评论(0) 推荐(0) 编辑
摘要: def search(data_set,find_num): mid = len(data_set) /2 print mid if len(data_set) == 1: if data_set[mid] == find_num: print ('End start: ',find_num) re 阅读全文
posted @ 2016-04-19 18:11 FreeMan1 阅读(173) 评论(0) 推荐(0) 编辑
摘要: class Singleton(object): def __new__(cls,*args,**kwargs): if not hasattr(cls,'_inst'): cls._inst=super(Singleton,cls).__new__(cls,*args,**kwargs) retu 阅读全文
posted @ 2016-04-19 18:11 FreeMan1 阅读(438) 评论(0) 推荐(0) 编辑