[Paraview] arguments

pat marion pat.marion at kitware.com
Thu May 6 10:09:09 EDT 2010


Use pqPythonDialog::runString(const QString& script).  Calling
pqPythonDialog::runString("execfile('script.py')") is the same as calling
pqPythonDialog::runScript(QStringList("script.py")).

Pat

2010/5/6 Jérôme Plumecoq <jerome.plumecoq at c-s.fr>

>  Yes, indeed, I want to pass arguments to the python script, not run a
> script when launching paraview.
>
> Le 06/05/2010 15:38, pat marion a écrit :
>
> To pass command options to the script, then you could set your arguments in
> sys.argv before calling the script.
>
> import sys
> sys.argv = ['script.py', 'arg1', 'arg2']
> execfile('script.py')
>
> Pat
>
>
> 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...
>
> Jérôme
>
>
>
>  On Thu, May 6, 2010 at 9:36 AM, Eric E. Monson <emonson at cs.duke.edu>wrote:
>
>> 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.
>>
>> -Eric
>>
>>
>> On May 6, 2010, at 9:32 AM, Utkarsh Ayachit wrote:
>>
>> > You can use the --script option.
>> >
>> >  --script=opt          Set a python script to be evaluated on startup.
>> >
>> > e.g.
>> >> ./paraview --script=/tmp/foo.py
>> >
>> > Utkarsh
>> >
>> > 2010/5/6 Jérôme Plumecoq <jerome.plumecoq at c-s.fr>:
>> >> Hi !
>> >>
>> >> I'm new two ParaView and I have one question :
>> >>
>> >> I would like to launch a script shell directly from a button (whitout
>> >> opening the script shell). So I have implemented a plugin which adds a
>> new
>> >> menu (*), and hence I can launch a python script using pqPythonManager
>> and
>> >> runScript() from pqPythonDialog.
>> >>
>> >> But I would like to launch a script with command line options.
>> >>
>> >> do you know if it is possible ? And if it is, how to do this ?
>> >>
>> >> I use version 3.8.0-RC1 of ParaView.
>> >>
>> >> thanks !
>> >>
>> >> Jérôme
>> >>
>> >> (*) my goal is to add a new GUI where the user can enter some
>> informations,
>> >> and launching a python script using these informations.
>> >>
>> >> _______________________________________________
>> >> 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
>>
>> _______________________________________________
>> 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
>
>
>
> _______________________________________________
> 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/20100506/5762f6ff/attachment-0001.htm>


More information about the ParaView mailing list