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