1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| class cCoeff(object):
def __init__(self, nom, temp, coeff):
self.nom=nom
self.temp=temp
self.vect=vect
# __init__()
# class cCoeff
class cMater(object):
def __init__(self, nom, coeff):
self.nom=nom
self.coeff=coeff
# __init__()
# class cMater
class cZone(object):
def __init__(self, nom, mater, temp):
sef.nom=nom
self.mater=mater
self.temp=temp
# __init__()
# class cZone
montruc=cZone(
nom="zoneA",
mater=cMater(
nom="materiau A",
coeff=cCoeff(
nom="coeffA",
temp=37.5,
coeff=12.45,
),
),
temp=45,
)
print monTruc.mater.coeff.temp # Donnera 37.5
print monTruc.temp # Donnera 45 |
Partager