If I am not mistaken you want something like this: <br><br>1) <a href="http://paste-it.net/public/i2de44d/">http://paste-it.net/public/i2de44d/</a> (with threads and classes)<br><br>2) <a href="http://paste-it.net/public/f5e340e/">http://paste-it.net/public/f5e340e/</a> (without threads and classes)<br>
<br>Note that without threads, we need to use the update() method. However, without threads you will experience some degree of &quot;blockage&quot; in the application anyway. <br><br><br><div class="gmail_quote">2010/8/18 Alex Ter-Sarkissov <span dir="ltr">&lt;<a href="mailto:sigma.z.1980@gmail.com">sigma.z.1980@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">thanks, in one of these articles it says. &#39;<span style="font-family:Verdana, Georgia, serif;font-size:14px">Be careful - Tkinter in not re-entrant&#39;. MAybe this is the problem? So far I&#39;ve tried</span><div>

<font face="Verdana, Georgia, serif" size="4"><span style="font-size:14px"><br></span></font></div><div><font face="Verdana, Georgia, serif" size="4"><span style="font-size:14px">(1) Label(mainframe.update_idletasks(),textvariable=best,bg=&#39;#321000&#39;,fg=&#39;#000fff000&#39;,font=(&quot;Helvetica&quot;,x1)).grid(column=1,row=1)</span></font></div>

<div><font face="Verdana, Georgia, serif" size="4"><span style="font-size:14px"><br></span></font></div><div><font face="Verdana, Georgia, serif" size="4"><span style="font-size:14px">and</span></font></div>
<div><font face="Verdana, Georgia, serif" size="4"><span style="font-size:14px"><br></span></font></div><div><font face="Verdana, Georgia, serif" size="4"><span style="font-size:14px">(2)</span></font></div>
<div><font face="Verdana, Georgia, serif" size="4"><span style="font-size:14px">mainframe = Frame(root)<div>mainframe.grid(column=1000, row=1000, sticky=(N, W, E, S))</div>
<div>mainframe.columnconfigure(0, weight=1)</div><div>mainframe.rowconfigure(0, weight=1)</div><div>mainframe.update()</div><div><br></div><div>Neither worked, of course, otherwise I woudln&#39;t be posting it) </div><div>

<br></div><div>I&#39;m not using any classes</div></span></font><br><div class="gmail_quote">2010/8/18 Cameron Laird <span dir="ltr">&lt;<a href="mailto:Cameron@phaseit.net" target="_blank">Cameron@phaseit.net</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Aug 18, 2010 at 12:50:38AM +1200, Alex Ter-Sarkissov wrote:<br>
                        .<br>
                        .<br>
                        .<br>
<div><div></div><div>&gt; I have some elements on the screen (Labels, most importantly) which content<br>
&gt; has to be updated every iteration of the algorithm run, e.g. &quot;Iteration =&quot;<br>
&gt; [i] for i in range(n). I&#39;ve tried using mainframe.update_idletasks()<br>
&gt; and Label(mainframe.update_ideltasks(),textvariable=var).grid(column=1,row=1),<br>
&gt; but without success so far. In MATLAB this command is drawnow.<br>
</div></div>                        .<br>
                        .<br>
                        .<br>
I believe I understand your description.<br>
<br>
For a &quot;quick fix&quot;, I recommend you experiment with update() (as<br>
opposed to update_idletasks()) applied to mainframe.<br>
<br>
For better long-term maintainability, though, you almost<br>
certainly should &quot;return to the event loop&quot; on each iteration<br>
of your run (there are also multi-threading approaches, but<br>
they&#39;re somewhat trickier to code correctly).<br>
<br>
You might find &lt;URL: <a href="http://wiki.tcl.tk/1255" target="_blank">http://wiki.tcl.tk/1255</a> &gt;, &lt;URL:<br>
<a href="http://wiki.tcl.tk/1526" target="_blank">http://wiki.tcl.tk/1526</a> &gt;, and &lt;URL:<br>
<a href="http://osdir.com/ml/python.tkinter/2008-05/msg00014.html" target="_blank">http://osdir.com/ml/python.tkinter/2008-05/msg00014.html</a> &gt; of<br>
interest.<br>
</blockquote></div><br></div>
<br>_______________________________________________<br>
Tkinter-discuss mailing list<br>
<a href="mailto:Tkinter-discuss@python.org">Tkinter-discuss@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tkinter-discuss" target="_blank">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>
<br></blockquote></div><br>