2016年10月25日

摘要: 固定一个参数 结果:10 “当函数的参数个数太多,需要简化时,使用functools.partial可以创建一个新的函数,这个新函数可以固定住原函数的部分参数,从而在调用时更简单。” 阅读全文
posted @ 2016-10-25 17:35 chinxfin 阅读(85) 评论(0) 推荐(0) 编辑
摘要: decorator就是一个返回函数的高阶函数 log函数,参数text decorator 参数为func函数 wrapper函数 打印text和func函数名 返回func函数 返回wrapper函数 返回decorator函数 埋日志 执行函数 结果:execute now(): now 阅读全文
posted @ 2016-10-25 15:32 chinxfin 阅读(112) 评论(0) 推荐(0) 编辑
摘要: % 求模运算,相当于mod % s%d 阅读全文
posted @ 2016-10-25 13:17 chinxfin 阅读(68) 评论(0) 推荐(0) 编辑

导航