摘要: os.path.dirname(__file__)使用 该测试脚本所在的位置:D:\第1层\第2层\第3层\第4层\第5层\test11.py test11.py [python] view plain copy import os #该文件所在位置:D:\第1层\第2层\第3层\第4层\第5层\t 阅读全文
posted @ 2018-01-21 17:03 裙下的小香蕉 阅读(1102) 评论(0) 推荐(0) 编辑
摘要: 作者:灵剑链接:https://www.zhihu.com/question/41006598/answer/148994582来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 bound和unbound方法是个很简单的概念。在许多语言当中,类似于a.b()这样的调用方 阅读全文
posted @ 2018-01-21 00:24 裙下的小香蕉 阅读(1274) 评论(0) 推荐(0) 编辑
摘要: 例子 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 class A(object): def foo(self,x): print "executing foo(%s,%s)"%(self,x) @classmethod def class_foo(cls,x): print "e 阅读全文
posted @ 2018-01-21 00:15 裙下的小香蕉 阅读(230) 评论(0) 推荐(0) 编辑
摘要: python基础 特性(property)、静态方法(staticmethod)、类方法(classmethod)、__str__的用法 阅读目录 一、特性(property) 二、静态方法(staticmethod) 三、类方法(classmethod) 四、附加知识点__str__的用法 回到顶 阅读全文
posted @ 2018-01-21 00:14 裙下的小香蕉 阅读(266) 评论(0) 推荐(0) 编辑