From the menu, select View → Python Shell which will bring up a Python interpreter where you can control Paraview via Python commands:

A Paraview Python script must first load in the Paraview.simple module:

>>> from paraview.simple import *

This command is automatically invoked when using the Python interpreter in Paraview, but would need to be manually added when using other Python interpreters (e.g. pvpython or pvbatch). Now we can try a few simple commands to show how the Python interpreter works:

### Draw and Show a sphere
>>> sphere = Sphere()
>>> Show()
>>> Render()
>>> ResetCamera()

### Run a shrink filter on the Sphere
>>> shrink = Shrink()
>>> Hide(sphere)
>>> Show(shrink)
>>> Render()

To reset our session, go to Edit → Reset Session

  • No labels