潦草白纸

03 2015 档案

Python装饰器学习(九步入门)
摘要:第一步:最简单的函数,准备附加额外功能#-*-coding:gbk-*-'''示例1:最简单的函数,表示调用了两次'''defmyfunc():print("myfunc()called.")myfunc()myfunc()第二步:使用装饰函数在函数执行前和执行后分别附加额外功能#-*-coding... 阅读全文

posted @ 2015-03-29 17:26 潦草白纸 阅读(592) 评论(0) 推荐(0)

Python数据库工具类MySQLdb使用
摘要:MySQLdb模块用于连接mysql数据库。基本操作#-*-coding:utf-8-*-#mysqldbimporttime,MySQLdb#连接conn=MySQLdb.connect(host="localhost",user="root",passwd="root",db="test",ch... 阅读全文

posted @ 2015-03-26 16:30 潦草白纸 阅读(2325) 评论(0) 推荐(0)

Python配置工具类ConfigParser使用
摘要:ConfigParser模块定义了类ConfigParser,用于实现配置文件解释器。该模块ConfigParser在Python3中,已更名为configparser。一,函数介绍1.读取配置文件read(filename)直接读取ini文件内容readfp(fp[,filename])从文件或f... 阅读全文

posted @ 2015-03-26 15:19 潦草白纸 阅读(2256) 评论(0) 推荐(0)

导航