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 <emon...@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.plume...@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

Reply via email to