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
<[email protected]> 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
_______________________________________________
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