摘要: os.path.abspath(path) #返回绝对路径 os.path.basename(path) #返回文件名 os.path.commonprefix(list) #返回list(多个路径)中,所有path共有的最长的路径。 os.path.dirname(path) #返回文件路径 os 阅读全文
posted @ 2019-03-11 16:33 就黎 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 问题你想在子类中调用父类的某个已经被覆盖的方法。 解决方案为了调用父类(超类)的一个方法,可以使用 super() 函数,比如: super() 函数的一个常见用法是在 __init__() 方法中确保父类被正确的初始化了: super() 的另外一个常见用法出现在覆盖Python特殊方法的代码中, 阅读全文
posted @ 2019-03-11 09:24 就黎 阅读(940) 评论(0) 推荐(0) 编辑