摘要: pass 阅读全文
posted @ 2013-04-10 10:40 thinbottle 阅读(98) 评论(0) 推荐(0) 编辑
摘要: #代码说明def aFunc_1(): passclass Myclass(object): a_arg = arg1 def __init__(sefl, *args, **kwargs): self.another_arg = args[] def afunc_2(self): print self.another_arg @classmethod def aFunc_3(cls): print "class method" @staticmethod def... 阅读全文
posted @ 2013-04-10 10:37 thinbottle 阅读(159) 评论(0) 推荐(0) 编辑
摘要: pass 阅读全文
posted @ 2013-04-10 10:36 thinbottle 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1、从字典中取值:1 mydict = {"key" : "value"}2 #使用get方法3 val = mydict.get("key")4 # val --> 'value'1 mydict.get("if_key_not_in_dict", "default value")2 #--> 'default value'3 #并没有改变原dict4 #mydict --> {"key":"value" 阅读全文
posted @ 2013-04-10 10:33 thinbottle 阅读(212) 评论(0) 推荐(0) 编辑