<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Testo fumetto Carattere";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.TestofumettoCarattere
        {mso-style-name:"Testo fumetto Carattere";
        mso-style-priority:99;
        mso-style-link:"Testo fumetto";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=IT link=blue vlink=purple><div class=WordSection1><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Segoe UI","sans-serif"'>[Python] Help Tkinter<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Ciao a tutti,<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>Ho definito un pulsante su un contenitore la cui pressione scatena questo:<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>def pulsante1Premuto(self, evento):<br>       for i in range (1, 10):<br>            self.listbox1.insert(END, str(i))<br>            time.sleep(1)<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Ora mi aspetto che nella mia listbox appaia un numero circa ogni secondo.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Cio non accade, i numeri vengono scritti tutti contemporanelamente dopo circa 10 secondi.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Quindi mi pare di capire che *prima* finisce il ciclo e *poi* scrive.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Come posso ottenere la scrittura ogni decimo di secondo?<o:p></o:p></p></div><div><div><p class=MsoNormal>Grazie.<br clear=all>-- <br>Riccardo Brazzale<br>Linux User #299418 Linux Machine #184578<o:p></o:p></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.5pt;padding:0cm 0cm 1.0pt 0cm'><p class=MsoNormal style='border:none;padding:0cm'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ciao,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ho provato ad inserire dopo<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> <span lang=EN-US>Time.sleep(1)<o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>self.listbox1.update()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>e funziona.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Il codice diventa:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>def pulsante1Premuto(self, evento):<br>       for i in range (1, 10):<br>            self.listbox1.insert(END, str(i))<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>time.sleep(1)<o:p></o:p></span></p><p class=MsoNormal>            self.listbox1.update()<o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><p class=MsoNormal>Buona giornata a tutti.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Attilio Menegon<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-indent:35.4pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p></div></div></div></div></body></html>