Before compiling paraview on windows, you might try this-<br><br>You can prevent processEvents from being called by taking the python console widget out of the loop.  Paraview sets sys.stdout and sys.stderr to a helper object that directs the output to the widget (where processEvents is called):<br>
<br>
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 9pt; color: rgb(0, 0, 0);">&gt;&gt;&gt; import sys</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 9pt; color: rgb(0, 0, 0);">&gt;&gt;&gt; sys.stdout.__class__</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 9pt; color: rgb(0, 150, 0);">&lt;type &#39;vtkPVPythonInterpretorWrapper&#39;&gt;</span></p><br>So you can reroute output to disk:<br>
<br>sys.stdout = open(&quot;stdout.txt&quot;, &quot;w&quot;)<br>sys.stderr = open(&quot;stderr.txt&quot;, &quot;w&quot;)<br><br>Now you won&#39;t see any output in the paraview gui, it will be written to those files instead.  The output isn&#39;t flushed on every write, so you might not see anything in the files until you quit paraview.  You could define your own stdout object that calls write on a file followed by flush.<br>
<br>Pat<br><br><div class="gmail_quote">On Sun, Oct 17, 2010 at 3:35 PM,  <span dir="ltr">&lt;<a href="mailto:m.c.wilkins@massey.ac.nz">m.c.wilkins@massey.ac.nz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Hi,<br>
<div class="im"><br>
&gt; Are you working from a paraview installer, or compiling paraview yourself?  I<br>
<br>
</div>downloaded stock standard 3.8.1 for Windows.<br>
<div class="im"><br>
&gt; was able to reproduce the linux bug (by putting a &#39;print &quot;hello&quot;&#39; at the end)<br>
&gt; and then solve it by commenting out two lines in ParaView/Qt/Python/<br>
&gt; pqPythonShell.cxx.  Just search for the lines with &quot;processEvents&quot; and comment<br>
&gt; them out and then recompile.<br>
<br>
</div>thanks.  Windows is not my platform of choice, i&#39;ve never successfully<br>
compiled up paraview with visual studio before.  anyway now I have a<br>
lot more motivation, and i do have the Paraview Guide with<br>
instructions, so I will give it a go.<br>
<div class="im"><br>
&gt; I&#39;ll try to explain it why this fixes the problem-<br>
&gt;<br>
&gt; Before paraview executes the python script it acquires a lock.  The lock is<br>
&gt; part of the python C api to help make things thread safe ( http://<br>
&gt; <a href="http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock" target="_blank">docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock</a> ).<br>
&gt;   Paraview doesn&#39;t use threads, but it uses multiple python interpreters, and<br>
&gt; each interpreter has its own &quot;thread state&quot;.  So before any code is executed by<br>
&gt; the paraview python shell, the shell acquires the lock to activate its<br>
&gt; interpreter.<br>
&gt;<br>
&gt; Next, the python script hits a print statement which sends an output string to<br>
&gt; the paraview python shell.  The shell calls processEvents so that the widget<br>
&gt; has an opportunity to repaint itself (make the text appear on your screen)<br>
&gt; without having to wait for the entire python script to complete execution.  The<br>
&gt; problem is that during processEvents, the events generated by calling show on a<br>
&gt; PyQt widget are also processed.  While processing these events, PyQt tries to<br>
&gt; acquire the lock itself, fails, and then waits- paraview hangs because this all<br>
&gt; happens in the same thread.  The fix is either to comment out the processEvents<br>
&gt; call in pqPythonShell.cxx, or release the lock before calling processEvents and<br>
&gt; then reacquire it afterward.<br>
<br>
</div>Thanks Pat.  I think I follow.  Although I&#39;m not sure what affect not<br>
calling processEvents will have on my widget.  Will it never have a<br>
chance to update?<br>
<div class="im"><br>
&gt; I have never tested PyQt+Paraview on Windows, there may be further bugs.  Also,<br>
&gt; there could be other scenarios where the paraview python shell and PyQt fight<br>
&gt; over the lock.<br>
<br>
</div>Ok, thanks.<br>
<div class="im"><br>
&gt; Hope this helps a bit!<br>
<br>
</div>Indeed it does, it is nice to know I&#39;m not trying to figure this out<br>
all by myself.<br>
<br>
Matt<br>
<br>
</blockquote></div><br>