[Paraview] arguments

Eric E. Monson emonson at cs.duke.edu
Thu May 6 10:01:12 EDT 2010


Hey Jérôme,

I don't know if this will be helpful to you, but I wrote a plugin (a long time ago, using an older API) that added a toolbar button which popped up a dialog and then ran a python script. The solution I used was to do a search-and-replace on the python script string to put values returned from the dialog directly into the python script before running it.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On May 6, 2010, at 9:38 AM, pat marion wrote:

> 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
> 
> 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
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100506/d4e8eb26/attachment.htm>


More information about the ParaView mailing list