Controlling Paraview GUI from Python IDLE

I am trying to control Paraview interactively using IDLE. This will require sending commands from IDLE and viewing the changes in Paraview. I would rather not use the python wrapper in Paraview.

So far I have managed to import Paraview modules (simple, server side ... etc) from IDLE. However, the commands sent are not reflected in Paraview. For example:

>>> from paraview.simple import *
>>> cone = Cone()
>>> Show()
>>> Render()

      

really creates a cone. However, the cone is displayed in a new independent OpenGL window, not in the Paraview GUI.

Is it possible to interactively control Paraview using IDLE? If so, how do you do it? Thanks to

+3


source to share


1 answer


You need to run paraview in multiclient / server mode. In terminal run pvserver.

./bin/pvserver --multi-clients

      

In another terminal, start paraview and connect to your server



./bin/paraview
File->Connect
AddServer -> Choose a name -> Configure -> Save
Connect

      

In the third terminal, start pvpython (or your own customized python)

./bin/pvpython
>> from paraview.simple import *
>> Connect(localhost)
>> Show()
>> Render()

      

+1


source







All Articles