<div dir="ltr">Il giorno 08 luglio 2013 19:05, Riccardo mancuso <span dir="ltr"><<a href="mailto:mancuso.riccardo63@gmail.com" target="_blank">mancuso.riccardo63@gmail.com</a>></span> ha scritto:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">ciao,<br>
al momento volevo procedere con la scrittura tramite un file di testo,<br>
in modo da organizzare in maniera testuale gli oggetti.<br>
Poi procedere nel trasformare questa modalità, tramite una GUI.<br>
Ma intanto volevo capire come organizzare le classi.<br>
<div class=""><div class="h5"><br></div></div></blockquote><div style>Io farei una cosa di questo genere:</div><div style><br></div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">class Locale(object):</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">        def __init__(self):</span></div><div class="gmail_quote"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">                <informazioni presenti in tutte i locali></span></div>
<div class="gmail_quote">                self.mobili = []   # lista che contiene i mobili di questo locale<br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<div class="gmail_quote"><font face="arial, sans-serif"><div class="gmail_quote">class Cucina(Locale):</div><div class="gmail_quote">        def __init__(self):</div><div class="gmail_quote" style>                Locale.__init__(self)</div>
<div class="gmail_quote" style>                <Informazioni relative alle cucine></div><div class="gmail_quote"><br></div></font></div><div class="gmail_quote"><font face="arial, sans-serif">class Mobile(object):</font></div>
<div class="gmail_quote"><font face="arial, sans-serif">        def __init__(self):</font></div><div class="gmail_quote"><font face="arial, sans-serif">                self.colore = ...</font></div><div class="gmail_quote">
<font face="arial, sans-serif">                self.dimensioni = (..., ..., ...)</font></div><div class="gmail_quote"><font face="arial, sans-serif">                self.posizione = (..., ...)</font></div><div class="gmail_quote">
<font face="arial, sans-serif">               ….</font></div><div class="gmail_quote"><font face="arial, sans-serif">                self.accessori = []</font></div><div class="gmail_quote"><br></div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">class Lavello(Mobile):</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">        def __init__(self):</span></div><div class="gmail_quote">                Mobile.__init__(self)<br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">                self.marca = []</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">                super(Lavello, self).__init__()</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">...</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">class Forno(Mobile):</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">        def __init__(self):</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">                self.attributo = []</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">                super(Forno, self).__init__()</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><div style> Ciao</div></div><div><br></div>-- <br><br>Daniele<br><br><a href="http://www.fugamatematica.blogspot.com">www.fugamatematica.blogspot.com</a><br>
<br>    giusto!<br>    nel verso<br>    forse è perché non guardiamo le cose<br>    Quando non ci capiamo,<br>
</div></div>