摘要: 第一种 第二种 shell下的一句话脚本,在命令行执行以下语句 阅读全文
posted @ 2018-11-10 15:37 anobscureretreat 阅读(153) 评论(0) 推荐(0)
摘要: 这个也是python彪悍的特性. 自省就是面向对象的语言所写的程序在运行时,所能知道对象的类型.简单一句就是运行时能够获得对象的类型.比如type(),dir(),getattr(),hasattr(),isinstance(). a = [1,2,3] b = {'a':1,'b':2,'c':3 阅读全文
posted @ 2018-11-10 00:43 anobscureretreat 阅读(120) 评论(0) 推荐(0)
摘要: a = 1 def fun(a): a = 2 fun(a) print a # 1 a = [] def fun(a): a.append(1) fun(a) print a # [1] 阅读全文
posted @ 2018-11-10 00:32 anobscureretreat 阅读(130) 评论(0) 推荐(0)