[Paraview] Script driven paraview

Pat Marion pat.marion at kitware.com
Thu May 9 20:33:50 EDT 2013


Hi Tim,

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:

import sys
sys.stdout = sys.__stdout__
sys.stderr = sys.__stderr__

For documentation, see:

http://docs.python.org/2/library/sys.html#sys.stdout


Pat


On Fri, May 10, 2013 at 1:40 AM, Timothy Cale <drtsc.para at gmail.com> wrote:

> Utkarsh:
>
> Thanks! Works!
>
> I had tried that: I thought it had not worked, because it (python?,
> pvpython?) did not print to the screen from a test script.
>
> 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.
>
> Thanks,
> Tim
>
>
> On Wed, May 8, 2013 at 8:09 AM, Utkarsh Ayachit <
> utkarsh.ayachit at kitware.com> wrote:
>
>> You can use the "--script" command line argument to "paraview"
>> executable to run a Python script after startup e,g,
>> > paraview --script=show_vtu.py
>>
>> Utkarsh
>>
>> On Sat, May 4, 2013 at 12:45 PM, Timothy Cale <drtsc.para at gmail.com>
>> wrote:
>> > I would like to display a set of meshes that result from a (bash) script
>> > driven set of simulations
>> > and meshing steps.
>> >
>> > I have written a script that does what I want (at least basically), if I
>> > manually go into the paraview
>> > gui and start the (Tools -->) Python Shell, then hit run script and
>> select
>> > the desired script.
>> >
>> > In an attempt to automate the visialization, I wrote a bash script with
>> the
>> > two relevant lines being:
>> >
>> > paraview &>/dev/null &
>> > pvpython show_vtu.py
>> >
>> > This generates non-persistent, non-interactive images that I expect -
>> though
>> > it would be good
>> > to know if there is a way to make such images persistent and
>> interactive.
>> > (in addition to
>> > starting paraview)
>> >
>> > Question:  Is there a way to use such a script (bash, python called from
>> > bash . . . ) to
>> > start paraview, and use a script to visualize data in the gui?
>> >
>> > Thanks,
>> > Tim
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the ParaView Wiki at:
>> > http://paraview.org/Wiki/ParaView
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.paraview.org/mailman/listinfo/paraview
>> >
>>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130510/554aadc9/attachment.htm>


More information about the ParaView mailing list