Python-调用 Private 变量 发表于 2017-04-21 | 分类于 Python | | Python 调用 Private 变量。 123456789101112class P: def __init__(self, name, alias): self.name = name # public self.__alias = alias # private def who(self): print('name : ', self.name) print('alias : ', self.__alias) from p import Px = P(name='Alex', alias='amen')x._P__alias