# running python scripts with load state for parafoam

**URL:** https://discourse.paraview.org/t/running-python-scripts-with-load-state-for-parafoam/10156
**Category:** ParaView Support
**Tags:** python
**Created:** [August 17, 2022, 9:08am UTC](https://discourse.paraview.org/t/running-python-scripts-with-load-state-for-parafoam/10156 "2022-08-17T09:08:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rho\_viz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@rho\_viz](https://discourse.paraview.org/u/rho_viz)
#### Post date: [August 17, 2022, 9:08am UTC](https://discourse.paraview.org/t/running-python-scripts-with-load-state-for-parafoam/10156/1 "2022-08-17T09:08:09Z")

</div>

I’m trying to automate generating animations with parafoam using a python script.

The script loads a state file, chooses the view of interest and creates an animation of that view. I’m currently unable to load the state file.

Currently, the script:

```auto
from paraview.simple import
print("done")
servermanager.LoadState("script.pvsm")
print("done1")

```

returns :

```auto
done
I/O : uncollated
Aborted (core dumped)

```

I unable to figure out what this error means. Is parafoam unable to load the state file or is there an error in the state file itself?

Im currently running the script on the terminal using the command:  
`LD_PRELOAD=/opt/paraviewopenfoam56/lib/libvtkpqCore-pv5.6.so.1 /opt/paraviewopenfoam56/bin/pvpython trial_animations.py`

I have also noticed that the author in [Auto-Load OpenFOAM files and State [SCRIPTS INCLUDED]](https://discourse.paraview.org/t/auto-load-openfoam-files-and-state-scripts-included/7102) uses _LoadState_ instead of _servermanager.LoadState_

Most notably, _servermanager.LoadState_ does not allow arguments like _LoadStateDataFileOptions_ which is allowed in _LoadState_.

What is the correct command to be used if I’m using parafoam on a server?

Thank you for the reading through

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 29, 2022, 4:38am UTC](https://discourse.paraview.org/t/running-python-scripts-with-load-state-for-parafoam/10156/2 "2022-08-29T04:38:24Z")

</div>

Hi @rho_viz ,

This forum is about ParaView, not parafoam.

However, you should be able to try your script with ParaView. Just download the ParaView release here:  
[https://www.paraview.org/download/](https://www.paraview.org/download/)

best,
