If you set a variable in the paraview python console before running a script, the script will have access to that variable.  So you can pass arguments to a python script by just setting sys.argv in the python console before running the script.<br>
<br>Sean... I happen to have a patch that allows raw_input() to work from the paraview gui.  Patch is attached.  When the script calls raw_input() it causes a focused qt text entry box to appear at the cursor.  The entire paraview gui is blocked until the user hits enter.  Not perfectly elegant, but works pretty well.<br>
<br>The pvblot plugin I wrote makes extensive use of querying the user for input from the gui.  I decided not to use raw_input() because it blocks the gui.  Instead I cooked up a fancy asynchronous input scheme using python generators, decorators, and the yield statement.  It works really well, but requires that you write your script using yield instead of raw_input().<br>
<br>Berk, I think we could add a method to the paraview.simple module that does a callback to the gui for a file dialog, it would be similar to my attached raw_input() patch.<br><br>Pat<br><br><div class="gmail_quote">On Thu, Feb 18, 2010 at 12:27 PM, Sean Ziegeler <span dir="ltr">&lt;<a href="mailto:sean.ziegeler@nrlssc.navy.mil">sean.ziegeler@nrlssc.navy.mil</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Actually, that isn&#39;t a bad idea.  There doesn&#39;t seem to be a way of getting input to a Python script, as raw_input() doesn&#39;t appear to work in the Python Shell (in the PV GUI, at least) either.<div class="im">
<br>
<br>
On 02/18/10 08:19, Berk Geveci wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
I didn&#39;t mention Python because it doesn&#39;t give you a way of popping up<br>
a file chooser - you have to edit the script and change the file name.<br>
Maybe we should add a Python command to pop up the file chooser... It is<br>
not super easy but if there is enough demand, we can do it. Feel free to<br>
add a feature request to the bug tracker or uservoice.<br>
<br>
-berk<br>
<br>
On Thu, Feb 18, 2010 at 8:06 AM, Jean M. Favre &lt;<a href="mailto:jfavre@cscs.ch" target="_blank">jfavre@cscs.ch</a><br></div><div><div></div><div class="h5">
&lt;mailto:<a href="mailto:jfavre@cscs.ch" target="_blank">jfavre@cscs.ch</a>&gt;&gt; wrote:<br>
<br>
    Natalie Happenhofer wrote:<br>
     &gt; Another topic - selecting volumes of interest: I can do that for<br>
    one file, and it works well. But is it really necessary to repeat<br>
    this procedure for every file I open in Paraview? Is it possible to<br>
    select a volume of interest and for every file I open afterward,<br>
    just this VoI is displayed?<br>
     &gt;<br>
     &gt;<br>
    I would suggest doing this in Python in order to avoid reading the full<br>
    resolution dataset by default. When opening a file, paraview forces you<br>
    to click Apply before you can do anything else (such as creating an<br>
    Extract Subset filter). Thus, the data reader uses<br>
    UPDATE_EXTENT=WHOLE_EXTENT and you may run out of memory before being<br>
    able to subset the grid.<br>
<br>
    if instead, you instantiate your reader, do not execute it, do not<br>
    create a representation for it, then create an Extract Subset with the<br>
    VOI you desire, and then execute the whole thing, you will end-up<br>
    passing the VOI extents upstream directly to the reader, and your reader<br>
    will only execute once with the correct extents.<br>
<br>
    Use the python shell and the followin example:<br>
<br>
    reader = XMLImageDataReader( FileName= &#39;/path/to/data/foo.vti&#39;] )<br>
    reader.PointArrayStatus = [&#39;data1&#39;]<br>
<br>
    ExtractSubset1 = ExtractSubset()<br>
<br>
    ExtractSubset1.VOI = [2000, 2255, 2000, 2255, 2000, 2255]<br>
<br>
    DataRepresentation2 = Show(ExtractSubset1)<br>
<br>
    Render()<br>
<br>
    Jean--<br>
    Swiss National Supercomputing Center<br>
    _______________________________________________<br></div></div>
    Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<div class="im"><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>
<br>
<br>
<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>
</div></blockquote><div><div></div><div class="h5">
_______________________________________________<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>
</div></div></blockquote></div><br>