concept of creating structures in python

Dec. 12, 2008
5:52 a.m.
Hello Everybody I want to create a structure within a structure i.e. nested structures in python. I tried with everything but its not working. my code is like this: class L(Structure): def __init__(self,Name='ND',Addr=0,ds_obj = D()): self.Name = Name self.Addr = Addr self.ds_obj = ds_obj class D(Structure): def __init__(self,dataName='ND',index = 0,ele_obj=E()): self.dataName = dataName self.index = index self.ele_obj = ele_obj these are two structures. I want to refer D structure in L one and use it. I want to access the value of D structure like L.D.index = 0. Please help me Thanks in advance Navneet
5920
Age (days ago)
5920
Last active (days ago)
0 comments
1 participants
participants (1)
-
navneet khanna