[Paraview] Python Script
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Tue Dec 3 22:24:29 EST 2013
Yes:
import paraview
import paraview.servermanager
pm = paraview.servermanager.vtkProcessModule.GetProcessModule()
type = pm.GetProcessTypeAsInt()
for Python console and pvpython, the type will be pm.PROCESS_CLIENT
for pvbatch it will be pm.PROCESS_BATCH
To determine if it's Python console or pvpython, you can check
paraview.fromGUI
On Sat, Nov 30, 2013 at 5:59 AM, Felipe Bordeu Weldt
<felipe.bordeu at ec-nantes.fr> wrote:
> Hi,
>
> It is possible to know if my script (in python) is running under ParaView (using run script from the python console) or pvpython of pvbatch.
>
> I do some post treatment of my data( set up of a pipeline + some calculations), and I want to use the same script for the visualization and the generation of quantities of interest. The main part of the script is the same for both cases (visualization and generation of data), and only the last part is different.
>
> So, my idea is to detect under witch environment I'm working so I can choose the last part of the script.
>
> Is this possible??
>
> Thanks
> Felipe
> _______________________________________________
> 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
More information about the ParaView
mailing list