# Running a script in pvpython

**URL:** https://discourse.paraview.org/t/running-a-script-in-pvpython/12491
**Category:** ParaView Support
**Created:** [July 11, 2023, 1:54am UTC](https://discourse.paraview.org/t/running-a-script-in-pvpython/12491 "2023-07-11T01:54:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [July 11, 2023, 1:54am UTC](https://discourse.paraview.org/t/running-a-script-in-pvpython/12491/1 "2023-07-11T01:54:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [July 11, 2023, 10:41am UTC](https://discourse.paraview.org/t/running-a-script-in-pvpython/12491/2 "2023-07-11T10:41:16Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [July 11, 2023, 4:41pm UTC](https://discourse.paraview.org/t/running-a-script-in-pvpython/12491/3 "2023-07-11T16:41:54Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [July 29, 2023, 10:33pm UTC](https://discourse.paraview.org/t/running-a-script-in-pvpython/12491/4 "2023-07-29T22:33:29Z")

</div>

IPython has far better support for this. See [this SO question about how it works](https://stackoverflow.com/questions/10886946/how-does-ipythons-magic-paste-work). This makes me think that buttons for “run code from clipboard” (ideally with a preview…) would be useful.
