abstract:實(shí)例化對象名._類名__私有屬性名 class Flylove: price = 123 def __init__(self): self.__directi
實(shí)例化對象名._類名__私有屬性名
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
更多關(guān)于python直接訪問私有屬性的簡單方法請關(guān)注PHP中文網(wǎng)(ipnx.cn)其他文章!