<div dir="ltr"><div>Hi Tim,<br><br>ParaView reassigns sys.stdout so that output can be routed to the ParaView python console window. Your script could set stdout back to the original value:<br><br></div>import sys<br>sys.stdout = sys.__stdout__<br>
<div>sys.stderr = sys.__stderr__<br></div><div><br>For documentation, see:<br><br><a href="http://docs.python.org/2/library/sys.html#sys.stdout" target="_blank">http://docs.python.org/2/library/sys.html#sys.stdout</a><br>
<br><br></div><div>
Pat<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 10, 2013 at 1:40 AM, Timothy Cale <span dir="ltr"><<a href="mailto:drtsc.para@gmail.com" target="_blank">drtsc.para@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Utkarsh:<div><br></div><div>Thanks! Works!</div><div><br></div><div>I had tried that: I thought it had not worked, because it (python?, pvpython?) did not print to the screen from a test script. </div>
<div><br></div><div>Is there a way to print info to the screen (or to a specified file)? When I use "Run Script" (to run show_vtu.py) from the python shell that is started when Tools -> Python Shell is manually selected, prints to the screen work.</div>
<div><br></div><div>Thanks,</div><div>Tim</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 8, 2013 at 8:09 AM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can use the "--script" command line argument to "paraview"<br>
executable to run a Python script after startup e,g,<br>
> paraview --script=show_vtu.py<br>
<br>
Utkarsh<br>
<div><div><br>
On Sat, May 4, 2013 at 12:45 PM, Timothy Cale <<a href="mailto:drtsc.para@gmail.com" target="_blank">drtsc.para@gmail.com</a>> wrote:<br>
> I would like to display a set of meshes that result from a (bash) script<br>
> driven set of simulations<br>
> and meshing steps.<br>
><br>
> I have written a script that does what I want (at least basically), if I<br>
> manually go into the paraview<br>
> gui and start the (Tools -->) Python Shell, then hit run script and select<br>
> the desired script.<br>
><br>
> In an attempt to automate the visialization, I wrote a bash script with the<br>
> two relevant lines being:<br>
><br>
> paraview &>/dev/null &<br>
> pvpython show_vtu.py<br>
><br>
> This generates non-persistent, non-interactive images that I expect - though<br>
> it would be good<br>
> to know if there is a way to make such images persistent and interactive.<br>
> (in addition to<br>
> starting paraview)<br>
><br>
> Question: Is there a way to use such a script (bash, python called from<br>
> bash . . . ) to<br>
> start paraview, and use a script to visualize data in the gui?<br>
><br>
> Thanks,<br>
> Tim<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div></div>