Use pqPythonDialog::runString(const QString&amp; script).  Calling pqPythonDialog::runString(&quot;execfile(&#39;script.py&#39;)&quot;) is the same as calling pqPythonDialog::runScript(QStringList(&quot;script.py&quot;)).<br>
<br>Pat<br><br><div class="gmail_quote">2010/5/6 Jérôme Plumecoq <span dir="ltr">&lt;<a href="mailto:jerome.plumecoq@c-s.fr">jerome.plumecoq@c-s.fr</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  

<div bgcolor="#ffff99" text="#000000">
Yes, indeed, I want to pass arguments to the python script, not run a
script when launching paraview.<br>
<br>
Le 06/05/2010 15:38, pat marion a écrit :
<div class="im"><blockquote type="cite">To pass command options to the script, then you could set
your arguments in sys.argv before calling the script.<br>
  <br>
import sys<br>
sys.argv = [&#39;script.py&#39;, &#39;arg1&#39;, &#39;arg2&#39;]<br>
execfile(&#39;script.py&#39;)<br>
  <br>
Pat<br>
  <br>
</blockquote>
<br></div>
ok, but I would like to do it in C++ (with the pqPythonDialog&#39;s method
runScript(scripts), where scripts is a list (in fact, only one) of
python scripts...<br><font color="#888888">
<br>
Jérôme</font><div><div></div><div class="h5"><br>
<br>
<br>
<blockquote type="cite">
  <div class="gmail_quote">On Thu, May 6, 2010 at 9:36 AM, Eric E.
Monson <span dir="ltr">&lt;<a href="mailto:emonson@cs.duke.edu" target="_blank">emonson@cs.duke.edu</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;">I
think he meant that he wants to pass arguments to the script when he
launches it (the script), not run a script when he launches paraview
from the command line.<br>
    <font color="#888888"><br>
-Eric<br>
    </font>
    <div>
    <div><br>
    <br>
On May 6, 2010, at 9:32 AM, Utkarsh Ayachit wrote:<br>
    <br>
&gt; You can use the --script option.<br>
&gt;<br>
&gt;  --script=opt          Set a python script to be evaluated on
startup.<br>
&gt;<br>
&gt; e.g.<br>
&gt;&gt; ./paraview --script=/tmp/foo.py<br>
&gt;<br>
&gt; Utkarsh<br>
&gt;<br>
&gt; 2010/5/6 Jérôme Plumecoq &lt;<a href="mailto:jerome.plumecoq@c-s.fr" target="_blank">jerome.plumecoq@c-s.fr</a>&gt;:<br>
&gt;&gt; Hi !<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m new two ParaView and I have one question :<br>
&gt;&gt;<br>
&gt;&gt; I would like to launch a script shell directly from a button
(whitout<br>
&gt;&gt; opening the script shell). So I have implemented a plugin
which adds a new<br>
&gt;&gt; menu (*), and hence I can launch a python script using
pqPythonManager and<br>
&gt;&gt; runScript() from pqPythonDialog.<br>
&gt;&gt;<br>
&gt;&gt; But I would like to launch a script with command line options.<br>
&gt;&gt;<br>
&gt;&gt; do you know if it is possible ? And if it is, how to do this ?<br>
&gt;&gt;<br>
&gt;&gt; I use version 3.8.0-RC1 of ParaView.<br>
&gt;&gt;<br>
&gt;&gt; thanks !<br>
&gt;&gt;<br>
&gt;&gt; Jérôme<br>
&gt;&gt;<br>
&gt;&gt; (*) my goal is to add a new GUI where the user can enter some
informations,<br>
&gt;&gt; and launching a python script using these informations.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt;&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><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>
    </div>
  </blockquote>
  </div>
  <br>
  <pre><fieldset></fieldset>
_______________________________________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>

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>

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>

Follow this link to subscribe/unsubscribe:
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a>
  </pre>
</blockquote>
<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>