可以按以下方式访问对象中的对象
class P: def __init__(self): self.w = Q()class Q: def __init__(self): self.list = [3,4,5] def function(self): self.list[2] = 7 y = P()f = [y] print f[0].w.function() print f[0].w.list
输出结果
输出为
None [3, 4, 7]
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分