Use pqPythonDialog::runString(const QString& script). Calling pqPythonDialog::runString("execfile('script.py')") is the same as calling pqPythonDialog::runScript(QStringList("script.py")).<br>
<br>Pat<br><br><div class="gmail_quote">2010/5/6 Jérôme Plumecoq <span dir="ltr"><<a href="mailto:jerome.plumecoq@c-s.fr">jerome.plumecoq@c-s.fr</a>></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 = ['script.py', 'arg1', 'arg2']<br>
execfile('script.py')<br>
<br>
Pat<br>
<br>
</blockquote>
<br></div>
ok, but I would like to do it in C++ (with the pqPythonDialog'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"><<a href="mailto:emonson@cs.duke.edu" target="_blank">emonson@cs.duke.edu</a>></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>
> You can use the --script option.<br>
><br>
> --script=opt Set a python script to be evaluated on
startup.<br>
><br>
> e.g.<br>
>> ./paraview --script=/tmp/foo.py<br>
><br>
> Utkarsh<br>
><br>
> 2010/5/6 Jérôme Plumecoq <<a href="mailto:jerome.plumecoq@c-s.fr" target="_blank">jerome.plumecoq@c-s.fr</a>>:<br>
>> Hi !<br>
>><br>
>> I'm new two ParaView and I have one question :<br>
>><br>
>> I would like to launch a script shell directly from a button
(whitout<br>
>> opening the script shell). So I have implemented a plugin
which adds a new<br>
>> menu (*), and hence I can launch a python script using
pqPythonManager and<br>
>> runScript() from pqPythonDialog.<br>
>><br>
>> But I would like to launch a script with command line options.<br>
>><br>
>> do you know if it is possible ? And if it is, how to do this ?<br>
>><br>
>> I use version 3.8.0-RC1 of ParaView.<br>
>><br>
>> thanks !<br>
>><br>
>> Jérôme<br>
>><br>
>> (*) my goal is to add a new GUI where the user can enter some
informations,<br>
>> and launching a python script using these informations.<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<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>
> 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>
_______________________________________________<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>