分类: Python/Ruby
2013-02-18 22:53:34
python直接访问私有属性方式
实例化对象名._类名__私有属性名
class Flylove:
price = 123
def __init__(self):
self.__direction = 'go beijing .'
zIng = 'wait car,many person'
if __name__ == '__main__':
print Flylove.price
fly = Flylove()
print fly._Flylove__direction