2018年9月4日

Python内置函数eval

摘要: 英文文档: This function can also be used to execute arbitrary code objects (such as those created by compile()). In this case pass a code object instead o 阅读全文

posted @ 2018-09-04 18:52 Slege 阅读(168) 评论(0) 推荐(0) 编辑

Python内置函数compile

摘要: 英文文档: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1) 转载 阅读全文

posted @ 2018-09-04 18:38 Slege 阅读(721) 评论(0) 推荐(0) 编辑

Python subprocess模块

摘要: Python中可以执行shell命令的相关模块和函数有: os.system os.spawn* os.popen* --废弃 popen2.* --废弃 commands.* --废弃,3.x中被移除 随着Python版本的更新,过多的模块引起代码的复杂和冗余,因此Python引入了新模块subp 阅读全文

posted @ 2018-09-04 18:16 Slege 阅读(207) 评论(0) 推荐(0) 编辑

Python 内置函数super

摘要: super()函数是用于调用父类/超类的一个方法 super是用来解决多重继承问题的,直接用类名调用父类方法在使用单继承的时候没有问题,但是如果使用多继承,会涉及到查找顺序(MRO),重复调用(钻石继承)等问题 MRO就是类的方法解析顺序表,其实也就是继承父类方法时的顺序表 语法 参数 type:类 阅读全文

posted @ 2018-09-04 15:16 Slege 阅读(123) 评论(0) 推荐(0) 编辑

导航