2015.10.27
Python3 入门(没有输出结果)
http://www.cnblogs.com/fortran/archive/2010/08/22/1805690.html
Python3博客
http://blog.youkuaiyun.com/bolike/article/category/1365946
2.x 3.x区别
http://www.cnblogs.com/codingmylife/archive/2010/06/06/1752807.html
Python序列
http://blog.youkuaiyun.com/bolike/article/details/19997465
Python列表、元组区别:
1,列表可变,元组不可变
2,列表[],元组()
Python方法中self参数:
self 参数,它在所有的方法声明中都存在。这个参数代表实例对象本身,当你用实例调用方法时,有解释器悄悄地传递给方法的,所以,你不需要自己传递 self 进来,因为它是自动传入的。一般的方法会需要这个实例(self),而静态方法或类方法不会,其中类方法需要类而不是实例。
关于类属性,实例属性:
http://onlypython.group.iteye.com/group/wiki/1357-to-talk-about-the-types-of-properties-in-python-and-examples-of-the-types-of-attributes-the-difference
实例属性: 在__init__方法中添加的属性, 在其他位置添加也是可以的。
class A:
def __init__(self):
self.name = 0
#or
a = A()
a.name = 0
实例方法,类方法,静态方法:
实例方法隐含的参数为类实例,而类方法隐含的参数为类本身, 静态方法无隐含参数。
class Test(object):
def InstanceFun(self):
print("InstanceFun");
print(self);
@classmethod
def ClassFun(cls):
print("ClassFun");
print(cls);
@staticmethod
def StaticFun():
print("StaticFun");