08 2018 档案

摘要:from functools import update_wrapper def debug(func): def wrapper(): print "[DEBUG]: enter {}()".format(func.__name__) return func() return update_wrapper(wrapper,func)#使被修饰的函... 阅读全文

posted @ 2018-08-31 13:47 王将军之武库 阅读(139) 评论(0) 推荐(0) |

摘要:1.什么是xlrd模块? 2.为什么使用xlrd模块? 3.怎样使用xlrd模块? 1.什么是xlrd模块? ♦python操作excel主要用到xlrd和xlwt这两个库,即xlrd是读excel,xlwt是写excel的库。 今天就先来说一下xlrd模块: 一、安装xlrd模块 ♦ 到pytho 阅读全文

posted @ 2018-08-23 22:50 王将军之武库 |

摘要:class t(): pass class t2(): pass def test1(): a=10 b=t() d=t2() e=t2() def f1(c): print a print b print c f1() Disassembly of test1: 19 ... 阅读全文

posted @ 2018-08-14 13:30 王将军之武库 阅读(342) 评论(0) 推荐(0) |

摘要:闭包 e.g. def add(x): def do_add(value): return x + value return do_add add_5 = add(5) print add_5(1) # 6 print add_5(2) # 7 1 2 3 4 5 6 7 8 def add(x): 阅读全文

posted @ 2018-08-13 23:26 王将军之武库 阅读(156) 评论(0) 推荐(0) |

摘要:脚本函数编译后如何执行?脚本编译后是pyc码,pycodeobject对象的串行化。import时是对pyc文件反系列化。函数编译后会生成函数对象,函数对象的TP_call对应的是function_call。 阅读全文

posted @ 2018-08-13 23:21 王将军之武库 阅读(149) 评论(0) 推荐(0) |

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3