Running a script in pvpython

I need to run numerous files, one after the other, in pvpython. In other words, I want to do the following:

  • pvpython
  • from paraview.simple import *
  • runScript scriptA
  • Show()
  • Render()
  • runScript scriptB
  • Show()
  • Render()

And see what pvptyon would show, without closing pvpython. Is this possible? If so, is it documented in the Paraview Guide? If not, is there any reason this shouldn’t be a feature request?

Thanks everyone,

Alan, do you want the results to show up in sequence? Do you want to “page through them” by hitting a key on the keyboard, running the next script, and seeing the result? Or do you simply want to load and execute another Python script inside another Python script?

What I have in mind is being able to effectively cut and paste into the pvpython window. I don’t want to have to type all the detail for the IOSSReader, for instance. Ditto setting up other stuff such as some filters. I want to be able to create a trace of some functionality, and move that trace into the pvpython, and see the result.

I think what I am saying is the second of your two options.

IPython has far better support for this. See this SO question about how it works. This makes me think that buttons for “run code from clipboard” (ideally with a preview…) would be useful.